by Adam Yakish

Scenario

The client has a large site with many different service offerings. The services are not organized by subdomain, however, they are organized:

www.domain.com/service/service_type/service_type_page

The client seeks to increase email inquiries for a particular offering. There is no direct form in place for the action (and no hope of one anytime soon). Instead, there is a simple “mailto” link that a user can select to email the client about the offering. The Google Analytics tracking initiative here is to both report only on traffic within “/service/service_type” and also track clicks on the “mailto” link.

Solution

1) Create a Google Analytics Domain Profile

Create a new profile under the client’s domain for the desired segment.


 

2) Create a Virtual Page to Track Clicks on Outbound “mailto” Link

To track a virtual page, call _trackPageview within the outbound mailto link, or any outbound link for that matter. Insert this code into the object:

onClick=”javascript: pageTracker._trackPageview(‘/G1/goal_name.com’);”

The working code is as follows:

<a class=”ApplyClass” onclick=”javascript: pageTracker._trackPageview(‘/G1/goal_name.com’);” href=”mailto:target@domain.com”>Anchor Text</a>

3) Create a Goal for the Virtual Page


 

To create a goal for your virtual page, edit your newly created profile settings and add this goal:

Goal Type, “URL Destination” Match Type:”Head Match” (this is simply what was used in this example) Goal URL, “/G1/goal_name.com” (note this field with head match dose not require the use of RegEx). As you may guess, “/G1/goal_name.com” is arbitrary, you may assign this as anything you’d like. This format is nice because it allows you to keep goal numbers organized in reporting.


 

4) Create an Include filter for the Site Segment and the Virtual Page

Because of the way include filter work, it is a best practice to only apply one include filter to a profile. To include more than one string in the report, simply use the and/or RegEx, which is “|”.

by: Adam Yakish