Do you have a web activity on your website you want to be able to measure and track? Many sites have purposeful actions related to visitors activities, their sales process or after market support for example. While traditional pageviews or ecommerce conversion are more straightforward to understand and measure, other related events like a download of a support document, or video message may not be properly \u201ccounted\u201d or tracked as a pageview in Google Analytics. This is when it\u2019s time to implement a great Google Analytics feature called Event Tracking.
Event Tracking allows you to track visitor actions that don't correspond directly to pageviews. It's a great way to track events or activities like:
-
\t
- Downloads of a PDF or file \t
- Interaction with dynamic, AJAX sites \t
- Interaction with Adobe Flash objects \t
- Play of embedded videos and other media
Unlike virtual pageviews, Event Tracking will not alter your pageview count. This makes it the preferred method for tracking the interaction of visitor actions as noted above.
With Google Analytics, an event consists of:
-
\t
- Category: something being tracked, for example, "video. \u00a0The Category is used as the highest level tracking.\u00a0 This means it ties together all the other variables and should not be too unique per line.\u00a0 It is required.\u00a0 This means if you are tracking a series of events,\u00a0you would keep this the same per event page or action.\u00a0 If you are tracking a web form for instance, then keep all of these the same wording like \u201cWeb Form\u201d so they are grouped together. \t
- Action: an activity or interaction for example "play". The Action is used to track the type of so called \u2018actions\u2019 the web surfer is taking.\u00a0 So for this example, you would use \u201cViewed Form\u201d or \u201cCompleted Form\u201d or \u201cVideo Played\u201d or something similar. \t
- Labels: an optional attribute, for example, "President\u2019s Message". The label is used to show additional info about the event you are tracking.\u00a0 It is kind of like giving a page a title.\u00a0 In this case this could be \u201cPlayed Video Message\u201d or \u201cFilled Form Out\u201d or \u201cError On Form\u201d, or it could just be \u201cForm Page\u201d. \t
- Values: use it to assign a numerical value to a tracked page object. For example, you could use it to provide the time in seconds for an player to load, or you might trigger a dollar value when a specific playback marker is reached on a video player. This is great for counting or summing things up like download time.
Before inserting the event tracking code, as a reminder, the basic Google Analytics code looks like this:
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();
} catch(err) {}
</script>
Before starting to use event tracking a quick look at the syntax and the way you can use it reveal that the tracking code should look something like this:
_trackEvent(category, action, (optional) label, (optional) value)
Here\u2019s an example of the event tracking code to track Videos as the Category, Play as the Action, and President\u2019s Address as the Label.
<a href="#" onClick="_gaq.push(['_trackEvent', 'Videos', 'Play', 'President\'s Address]);">Play</a>
This code would track how often a video was played on a site.
With videos that are viewed on site you can not only track if visitors clicked\u00a0to play them, but also if they were paused or stopped half way through. This information will provide you insight on how useful your content is and may highlight areas in content that may need updating to make the site more engaging and relevant to what your visitors are looking for. In this way you can be sure to know how valuable your support documents, downloads and videos are to your site visitors as well as the overall website conversion process.
For more information on setting up event tracking and related Google Analytics Consulting Services, please contact us today!




