GoogleServices/Sources/doku/06_eventTrackerGuide.html

822 lines
48 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Event Tracking Guide - Google Analytics - Google Code</title>
<script type="text/javascript"><!--
(function(){function a(){this.t={};this.tick=function(c){this.t[c]=(new Date).getTime()};this.tick("start")}var b=new a;window.jstiming={Timer:a,load:b};if(window.external&&window.external.pageT)window.jstiming.pt=window.external.pageT;})();
var _tocPath_ = '/html/apis/analytics/_toc.ezt';
var codesite_token = '56328469b0a0a7c65c4a395ddd8cde4c';
var logged_in_user_email = 'dan1978@gmx.net';
//--></script>
<link href="06_eventTrackerGuide-Dateien/codesite.css" type="text/css" rel="stylesheet">
<script src="06_eventTrackerGuide-Dateien/codesite_head.js" type="text/javascript"></script>
<script type="text/javascript">CODESITE_CSITimer['load'].tick('bhs');</script>
<link rel="search" type="application/opensearchdescription+xml" title="Google Code" href="http://code.google.com/osd.xml">
<!--[if IE]><link rel="stylesheet" type="text/css" href="/css/iehacks.css"><![endif]-->
<link href="06_eventTrackerGuide-Dateien/semantic_headers.css" rel="stylesheet" type="text/css">
<link href="06_eventTrackerGuide-Dateien/local_extensions.css" rel="stylesheet" type="text/css">
<style type="text/css">
.minusImage { display: none; }
.tog-img { padding-right: .5em; }
.tog-right .tog-img { padding-left: .5em; }
</style>
<script type="text/javascript" src="06_eventTrackerGuide-Dateien/custom_tracker_min.js"></script>
<script src="06_eventTrackerGuide-Dateien/ga.js" async="" type="text/javascript"></script></head><body class="gc-documentation">
<div id="gb">
<span>
<b>dan1978@gmx.net</b>
|
<a href="http://code.google.com/u/dan1978@gmx.net/" id="projects-dropdown" onclick="return false;"><span style="text-decoration: underline;">My favorites</span> <span style="font-size: 0.75em;"></span></a>
|
<a id="lang-dropdown" href="http://code.google.com/" onclick="return false;"><span style="text-decoration: underline;">English</span> <span style="font-size: 0.75em;"></span></a>
| <a href="http://www.google.com/accounts/Logout?continue=http%3A%2F%2Fcode.google.com%2Fintl%2Fde%2Fapis%2Fanalytics%2Fdocs%2Ftracking%2FeventTrackerGuide.html" onclick="CODESITE_click('/gb/sc/signout');"><span style="text-decoration: underline;">Sign out</span></a>
</span>
</div>
<div class="gbh" style="left: 0px;"></div>
<div class="gbh" style="right: 0px;"></div>
<div id="gc-container">
<a id="top"></a>
<div id="skipto">
<a href="#gc-pagecontent">Skip to page content</a>
<a href="#gc-toc">Skip to main navigation</a>
</div>
<div id="gc-header">
<div id="logo"><a href="http://code.google.com/">
<img src="06_eventTrackerGuide-Dateien/code_logo.gif" alt="Google Code" style="border: 0pt none; margin: 3px 0pt 0pt;" height="40" width="167">
</a></div>
<div id="search">
<div id="searchForm">
<form id="cse" action="http://www.google.com/cse" accept-charset="utf-8" onsubmit="executeGSearch(document.getElementById('gsearchInput').value); return false;">
<noscript>
<input type="hidden" name="cref" value="http://code.google.com/cse/googlecode-context.xml">
</noscript>
<div id="gsc-search-box">
<input id="gsearchInput" name="q" maxlength="2048" class="gsc-input" autocomplete="off" title="Google Code Search" style="width: 345px;" type="text">
<div id="cs-searchresults" onclick="event.cancelBubble = true;"></div>
<input title="Search" id="gsearchButton" class="gsc-search-button" name="sa" value="Search" type="submit">
<div class="greytext">e.g. "adwords" or "open source"</div>
</div>
</form>
</div> <!-- end searchForm -->
</div> <!-- end search -->
</div> <!-- end gc-header -->
<div id="codesiteContent">
<a id="gc-topnav-anchor"></a>
<div id="gc-topnav"><img id="gc-star" src="06_eventTrackerGuide-Dateien/star_off.gif" height="15" width="15">
<h1 class="mozilla">Google Analytics</h1>
<ul id="docs" class="gc-topnav-tabs">
<li id="home_link">
<a href="http://code.google.com/apis/analytics/" title="Google Analytics home page">Home</a>
</li>
<li id="docs_link">
<a href="http://code.google.com/apis/analytics/docs/index.html" class="selected" title="Official Google Analytics documentation">Docs</a>
</li>
<li id="faq_link">
<a href="http://code.google.com/apis/analytics/docs/gdata/gdataFAQ.html" title="Answers to frequently asked questions about Google Analytics">FAQ</a>
</li>
<li id="articles_link">
<a href="http://code.google.com/apis/analytics/docs/gdata/gdataArticlesCode.html" title="Focused articles and tutorials for Google Analytics developers">Articles</a>
</li>
<li>
<a href="http://analytics.blogspot.com/" title="Official Google Analytics blog">Blog</a>
</li>
<li>
<a href="http://code.google.com/apis/analytics/groups/groups.html" title="Google Analytics developer forum">Forum</a>
</li>
<li>
<a href="http://www.google.com/analytics/tos.html" title="Google Analytics terms of service">Terms</a>
</li>
</ul>
</div> <!-- end gc-topnav -->
<div class="g-section g-tpl-210">
<div class="g-unit g-first" id="gc-toc">
<link href="06_eventTrackerGuide-Dateien/local_extensions.css" rel="stylesheet" type="text/css">
<ul class="treelist tlw-nested-only tlw-processed tlw-instance-0">
<li>
<ul>
<li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Expand Overview"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Expand Overview" class="tlw-control tlw-plus"></a><span class="tlw-title"><strong>Overview</strong></span></div><ul style="display: none;" id="0-sub-0">
<li><a href="http://code.google.com/apis/analytics/docs/concepts/gaConceptsOverview.html">Functional Overview</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/concepts/gaConceptsAccounts.html">Accounts &amp; Profiles</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/concepts/gaConceptsCookies.html">Cookies</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/concepts/gaConceptsDomains.html">Domains &amp; Directories</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/concepts/gaConceptsSampling.html">Sampling</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="dottedLine"></div>
<div class="sectionTitle"><span class="sectionFont">Tracking Code</span></div>
<ul class="treelist tlw-nested-only tlw-processed tlw-instance-1" style="margin-top: -15px;">
<li>
<ul>
<li><a href="http://code.google.com/apis/analytics/docs/tracking/home.html">Home</a></li>
<li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Collapse Getting Started"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Collapse Getting Started" class="tlw-control tlw-minus"></a><a href="http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html">Getting Started</a></div><ul style="display: block;" id="1-sub-0">
<li><a href="http://code.google.com/apis/analytics/docs/tracking/asyncUsageGuide.html">Async Usage</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/tracking/asyncMigrationExamples.html">Async Migration</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingEcommerce.html">Ecommerce Tracking</a></li>
<li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Collapse Event Tracking"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Collapse Event Tracking" class="tlw-control tlw-minus"></a><a href="http://code.google.com/apis/analytics/docs/tracking/eventTrackerOverview.html">Event Tracking</a></div><ul style="display: block;" id="1-sub-1">
<li class="selected"><a href="http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html">Implementing</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/tracking/eventTrackerWrappers.html">Extending</a></li>
</ul>
</li>
<li><a href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html">Cross-Domain Tracking</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingTraffic.html">Traffic Sources</a></li>
<li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Collapse Visitor Configuration"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Collapse Visitor Configuration" class="tlw-control tlw-minus"></a><a href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingVisitors.html">Visitor Configuration</a></div><ul style="display: block;" id="1-sub-2">
<li><a href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html">Custom Variables</a></li>
<li class="deprecated"><a href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingVisitorSegments.html">Custom Visitor Segments</a></li>
</ul>
</li>
<li><a href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingOverview.html">Traditional Snippet</a></li>
</ul>
</li>
<li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Expand Tracking Reference"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Expand Tracking Reference" class="tlw-control tlw-plus"></a><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApi.html">Tracking Reference</a></div><ul style="display: none;" id="1-sub-3">
<li>Global Objects
<ul>
<li><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApi_gat.html">_gat</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApi_gaq.html">_gaq</a></li>
</ul>
</li><li>Tracker Objects
<ul class="treelist tlw-processed tlw-instance-2">
<li><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApiBasicConfiguration.html">Basic Configuration</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApiCampaignTracking.html">Campaign Tracking</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApiDomainDirectory.html">Domains &amp; Directories</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApiEcommerce.html">Ecommerce</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApiEventTracking.html">Event Tracking</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApiSearchEngines.html">Search Engines and Referrers</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApiWebClient.html">Web Client</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApiUrchin.html">Urchin Server</a></li>
</ul>
</li>
</ul>
</li>
<li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Expand Libraries"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Expand Libraries" class="tlw-control tlw-plus"></a><span class="tlw-title">Libraries</span></div><ul style="display: none;" id="1-sub-4">
<li><a href="http://code.google.com/apis/analytics/docs/tracking/gadgetTracking.html">Gadgets</a></li>
<li><a href="http://code.google.com/chrome/extensions/trunk/tut_analytics.html">Chrome Extensions</a></li>
<li><a style="text-decoration: none;" href="http://code.google.com/mobile/analytics/docs/"><span style="text-decoration: underline;">Mobile</span><span class="new">&nbsp;&nbsp;Updated</span></a> (Labs <img src="06_eventTrackerGuide-Dateien/labs-11.png" alt="in Labs" style="padding: 0pt; margin: 0pt;">)</li>
<li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Expand Flash/Flex (Labs )"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Expand Flash/Flex (Labs )" class="tlw-control tlw-plus"></a><span class="tlw-title"><a href="http://code.google.com/apis/analytics/docs/tracking/flashTrackingIntro.html">Flash/Flex</a> (Labs <img src="06_eventTrackerGuide-Dateien/labs-11.png" alt="in Labs" style="padding: 0pt; margin: 0pt;">)</span></div><ul style="display: none;" id="1-sub-5">
<li><a href="http://code.google.com/apis/analytics/docs/tracking/flashTrackingSetupFlash.html">Flash Setup</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/tracking/flashTrackingSetupFlex.html">Flex Setup</a></li>
</ul>
</li>
<li><a href="http://code.google.com/apis/analytics/docs/tracking/silverlightTrackingIntro.html">Silverlight</a> (Labs <img src="06_eventTrackerGuide-Dateien/labs-11.png" alt="in Labs" style="padding: 0pt; margin: 0pt;">)</li>
</ul>
</li>
<li>
<a href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingTroubleshooting.html">Troubleshooting</a>
</li>
<li><a href="http://code.google.com/apis/analytics/docs/gaJS/changelog.html">Changelog - ga.js</a></li>
</ul>
</li>
</ul>
<div class="dottedLine"></div>
<div class="sectionTitle"><span class="sectionFont">Management API <span style="letter-spacing: normal;">(Labs <img src="06_eventTrackerGuide-Dateien/labs-11.png" alt="in Labs" style="padding: 0pt; margin: 0pt;">)</span></span></div>
<ul class="treelist tlw-nested-only tlw-processed tlw-instance-3" style="margin-top: -15px;">
<li>
<ul class="treelist tlw-processed tlw-instance-4">
<li><a href="http://code.google.com/apis/analytics/docs/mgmt/home.html">Home</a>
</li><li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Expand Getting Started"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Expand Getting Started" class="tlw-control tlw-plus"></a><a href="http://code.google.com/apis/analytics/docs/mgmt/mgmtDeveloperGuide.html">Getting Started</a></div><ul style="display: none;" id="3-sub-0">
<li><a href="http://code.google.com/apis/analytics/docs/mgmt/mgmtAuthentication.html">Authorization</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/mgmt/mgmtProtocol.html">Protocol</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/mgmt/mgmtJava.html">Java</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/mgmt/mgmtJavascript.html">Javascript</a></li>
</ul>
</li>
<li><a href="http://code.google.com/apis/analytics/docs/mgmt/mgmtFeedReference.html">Feed Reference</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/mgmt/mgmtLibraries.html">Libraries &amp; Examples</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/mgmt/changelog.html">Changelog</a></li>
</ul>
</li>
</ul>
<div class="dottedLine"></div>
<div class="sectionTitle"><span class="sectionFont">Export API <span style="letter-spacing: normal;">(Labs <img src="06_eventTrackerGuide-Dateien/labs-11.png" alt="in Labs" style="padding: 0pt; margin: 0pt;">)</span></span></div>
<ul class="treelist tlw-nested-only tlw-processed tlw-instance-5" style="margin-top: -15px;">
<li>
<ul>
<li><a href="http://code.google.com/apis/analytics/docs/gdata/home.html">Home</a></li>
<li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Expand Getting Started"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Expand Getting Started" class="tlw-control tlw-plus"></a><a href="http://code.google.com/apis/analytics/docs/gdata/gdataDeveloperGuide.html">Getting Started</a></div><ul style="display: none;" id="5-sub-0">
<li><a href="http://code.google.com/apis/analytics/docs/gdata/gdataAuthentication.html">Authorization</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gdata/2.0/gdataProtocol.html">Protocol</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gdata/2.0/gdataJava.html">Java</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gdata/2.0/gdataJavascript.html">Javascript</a></li>
<li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Expand Version 1.0"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Expand Version 1.0" class="tlw-control tlw-plus"></a><span class="tlw-title">Version 1.0</span></div><ul style="display: none;" id="5-sub-1">
<li><a href="http://code.google.com/apis/analytics/docs/gdata/1.0/gdataProtocol.html">Protocol</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gdata/1.0/gdataJava.html">Java</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gdata/1.0/gdataJavascript.html">Javascript</a></li>
</ul></li>
</ul>
</li>
<li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Expand Feed Reference"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Expand Feed Reference" class="tlw-control tlw-plus"></a><a href="http://code.google.com/apis/analytics/docs/gdata/gdataReference.html">Feed Reference</a></div><ul style="display: none;" id="5-sub-2">
<li><a href="http://code.google.com/apis/analytics/docs/gdata/gdataReferenceAccountFeed.html">Account Feed</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDataFeed.html">Data Feed</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gdata/gdataCommonQueries.html">Common Queries</a>
</li><li><a href="http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html">Query Explorer</a></li>
</ul></li>
<li><a href="http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDimensionsMetrics.html">Dimensions &amp; Metrics</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gdata/gdataLibraries.html">Libraries &amp; Examples</a></li>
<li style="padding-top: 0pt; padding-bottom: 0pt;">
<div class="tlw-title tlw-branch"><a href="javascript:void(0)" class="tlw-control" title="Expand Changelog &amp; Issues"><img src="06_eventTrackerGuide-Dateien/cleardot.gif" alt="Expand Changelog &amp; Issues" class="tlw-control tlw-plus"></a><span class="tlw-title">Changelog &amp; Issues</span></div><ul style="display: none;" id="5-sub-3">
<li><a href="http://code.google.com/apis/analytics/docs/gdata/changelog.html">Changelog</a></li>
<li><a href="http://code.google.com/p/gdata-issues/issues/list?can=2&amp;q=label:API-Analytics&amp;colspec=API+ID+Type+Status+Priority+Stars+Summary&amp;cells=tiles">Issue Tracker</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="dottedLine"></div>
<div class="sectionTitle"><span class="sectionFont">Website Optimizer <span style="letter-spacing: normal;">(Labs <img src="06_eventTrackerGuide-Dateien/labs-11.png" alt="in Labs" style="padding: 0pt; margin: 0pt;">)</span></span></div>
<ul class="treelist tlw-nested-only tlw-processed tlw-instance-6" style="margin-top: -15px;">
<li>
<ul>
<li><a href="http://code.google.com/apis/analytics/docs/gwo/index.html">Getting Started</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gwo/commonTasks.html">Common Tasks</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gwo/feedReference.html">Feed Reference</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/gwo/gwoFAQ.html">FAQ</a></li>
</ul>
</li>
</ul>
<a class="hidden" href="#gc-topnav-anchor">More Google Analytics resource links</a>
</div>
<div style="position: relative;" class="g-unit" id="gc-pagecontent">
<script type="text/javascript">CODESITE_docEarlyProcessing();</script>
<h1 class="page_title">Event Tracking Guide</h1>
<h3>Contents</h3>
<ol class="toc" id="toc-list">
<li><a href="#SettingUpEventTracking">Setting Up Event Tracking</a>
</li>
<li><a href="#Anatomy">Anatomy of Event Tracking</a>
<ol class="toc">
<li><a href="#Categories">Categories</a></li>
<li><a href="#Actions">Actions</a></li>
<li><a href="#Labels">Labels</a></li>
<li><a href="#Values">Values</a></li>
<li><a href="#Count">Implicit Count</a></li>
</ol>
</li>
<li><a href="#implementationConsiderations">Implementation Considerations</a></li>
</ol>
<h2><a name="SettingUpEventTracking" id="SettingUpEventTracking"></a>Setting Up Event Tracking </h2>
<p>Before you can view event tracking results in your reports, you must set it
up on your site following these steps. </p>
<ol>
<li><strong>Set up tracking on your site</strong>. Make sure you have set up tracking for your
website. For information on setting this up, see <a href="http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html">Tracking
Sites</a>.</li>
<li><strong>Call the <code>_trackEvent()</code> method</strong> in the source code of
a page object, widget, or video. <br>
<p>The specification
for the <code>_trackEvent()</code> method is: </p>
<pre>_trackEvent(category, action, opt_label, opt_value)</pre>
<ul class="listhead">
<li>category (required)
<p>The name you supply for the group of objects you want to track.</p>
</li>
<li>action (required)
<p>A string that is uniquely paired with each category, and
commonly used to define the type of user interaction for the web object.
</p>
</li>
<li>label (optional)
<p>An optional string to provide additional dimensions to the event data. </p>
</li>
<li>value (optional)
<p>An integer that you can use to provide numerical data about the user event. </p>
</li></ul></li>
<li><strong>View the reports.</strong> Once event tracking has been set up and working on your
site for a day, go to the <em>Content</em> section of the reports and view <em>Event
Tracking</em>.</li>
</ol>
<a name="Anatomy"></a><h2>Anatomy of Event Tracking </h2>
<p>The Event Tracking data model has the following components which map directly to elements in the Analytics Reports interface:</p><ul>
<li>categories</li>
<li>actions</li>
<li>labels</li>
<li>values</li>
<li>implicit count </li>
</ul>
<p>A simple example illustrates how you might use the Event Tracking method to record user interaction with a video <em>Play</em> link on your page. It assumes that <code>pageTracker</code> is the name used for your tracking object. </p>
<pre>&lt;a href="#" onClick="_gaq.push(['_trackEvent', 'Videos', 'Play', 'Baby\'s First Birthday']);"&gt;Play&lt;/a&gt;</pre>
<p>In this scenario, the reports for Events would display <em>Videos</em> as the Category, <em>Play</em> as the Action, and <em>Baby's First Birthday</em>
as the Label. The rest of this document describes these components in
detail. Bear in mind that when you implement Event Tracking, you can use
this data model as a guide, or you can simply use the <code>_trackEvent()</code> method to segment user interaction in any way that works for your data.</p>
<div align="right"><a href="#top" class="backtotop">Back to Top</a></div>
<a name="Categories" id="Categories"></a>
<h3>Categories</h3>
<p>For Event Tracking, a <em>category</em> is a name that you supply as a way to group objects that you want to track. It is the first parameter used in the <code>_trackEvent()</code> method and it is required.</p>
<p>The term <em>Category</em> appears in the reporting interface as
Top Categories in the Events Overview page. In this model, a category
represents the "root level" of the hierarchical structure of Event
Tracking, and you can use that structure in any way suitable to your
reporting needs. Typically, you will use the same category name multiple
times over related UI elements that you want to group under a given
category. </p>
<p>For example, you might track user interaction on three separate controls on a single video interface using:</p>
<pre>_gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);
_gaq.push(['_trackEvent', 'Videos', 'Pause', 'Gone With the Wind']);
_gaq.push(['_trackEvent', 'Videos', 'Stop', 'Gone With the Wind']);
</pre>
<p>Suppose you also want to track how many times the video is downloaded. You could use:</p>
<pre>gaq.push(['_trackEvent', 'Videos', 'Downloaded', 'Gone With the Wind']);
</pre>
<p>In this case, there would be only one category—Videos—in the
Events Overview page for Top Categories, and you could see aggregate
metrics for user interaction with the total set of elements for that
single video object. </p>
<p>However, it's likely that you will have more than one single
object that you want to track using Event Tracking, and it's worth
considering how you want to categorize your reporting before you
implement the call. For instance, you might want to track all separate
movies under the main category of "Videos" so that you get aggregate
numbers for all video interaction, regardless of which one users
interact with.</p>
<p> On the other hand, you might create separate categories based
on the type of video—one for movie videos and one for music videos. You
might also want a separate category for video downloads:</p>
<ul>
<li>Videos - Movies</li>
<li>Videos - Music</li>
<li>Downloads </li>
</ul>
<p>In this scenario, you can determine the total combined event count
for all three categories via the Total Events dashboard. The Total
Events metric displays all event counts for all categories that you
have supplied in your Event Tracking implementation. However, you will
not be able to view combined metrics for all Videos separately from
Downloads, because detailed event metrics are combined under their
respective categories. </p>
<p>While the Event Tracking object model is entirely flexible, you
should first plan your desired reporting structure before calling the <code>_trackEvent()</code>
method for similar web object elements. If you plan to use the same
category name in multiple locations, be careful to correctly reference
the desired category by name. For example, if you plan to call your
video tracking category "Video" and later forget and use the plural
"Videos," you will have two separate categories for video tracking.
Additionally, if you decide to change the category name of an object
that has already been tracked under a different name, the historical
data for the original category will not be re-processed, so you will
have metrics for the same web page element listed under two categories
in the reporting interface.</p>
<div align="right"><a href="#top" class="backtotop">Back to Top</a></div>
<h3><a name="Actions" id="Actions"></a>Actions</h3>
<p>The term "Action" in the Event Tracking model refers to the second parameter in the <code>_trackEvent()</code> method. It too is required.</p>
<pre>_gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);</pre>
<p>Typically, you will use the <code>action</code> parameter to
name the type of event or interaction you want to track for a particular
web object. For example, with a single "Videos" category, you can
track a number of specific events with this parameter, such as: </p>
<ul>
<li>Time when the video completes load</li>
<li>"Play" button clicks</li>
<li>"Stop" button clicks </li>
<li>"Pause" button clicks</li>
</ul>
<p>As with categories, the name you provide for an <code>action</code> is up to you, but keep in mind two important features of how an event action is used in the reports:</p>
<ul>
<li><strong>All actions are listed independently from their parent categories.</strong> <br>
This provides you with another useful way to segment the event data for your reports. </li>
<li><strong>A unique event is determined by a unique action name</strong>.<br>
You can use duplicate action names across categories, but this
can affect how unique events are calculated. See the suggestions below
and the <a href="#Count">Implicit Count</a> section for more details.</li>
</ul>
<p>To achieve the best possible reports for extensive Event
Tracking in your site, keep in mind the following suggestions for using
actions:</p>
<ul class="listhead">
<li>Action names should be relevant to your report data
<p>
Event Tracking combines metrics for the same action name
across two different categories. For example, if you use the action name
"Click" for both the "Downloads" category and the "Videos" category,
the metrics for the "Click" in the Top Actions report appears with all
interactions tagged with that same name. You could then view a detailed
break-down of the "Click" action by category in the next report level.
However, if you use the action "click" indiscriminately across your
Event Tracking implementation, the usefulness of that segment will be
diminished in the reports. Consider choosing action names that relate to
your data categories if you plan to use Event Tracking extensively on
your website. For example, you might choose to reserve the term "click"
for gadget interactions, while keeping the action terms, "Play,"
"Pause," and "Stop" reserved for video player interactions.</p>
</li>
<li>Use action names globally to either aggregate or distinguish user interaction
<p>For example, you can use "Play" as an action name to the
"Videos" category for all videos on your website. In this model, the Top
Actions report would provide aggregate data for events for the "Play"
action, and you can see how this event for your videos compares to other
events for the videos, such as "Pause" or "Stop."</p>
<p>However, suppose you want to use one video category for
your reports, but you want some information about two different video
player UIs. You can use the action name to distinguish the different
player chromes without having to create separate video categories. The
report can then distinguish the two player styles without losing the
benefits of aggregate data on all videos for your website.</p>
<pre>_gaq.push(['_trackEvent', 'Videos', 'Play - Mac Chrome');
_gaq.push(['_trackEvent', 'Videos', 'Play - Windows Chrome');
</pre>
</li>
<li>Action does not always mean "action"
<p>You can supply any string for the action parameter. In
some situations, the actual event or action name is not as meaningful,
so you might use the action parameter to track other elements. For
example, if you want to track page downloads, you could provide the
document file type as the action parameter for the download event. In
this scenario, your reports for the "Downloads" category would then be
broken out by file types (pdf, doc, xls). </p>
</li>
<li>Unique events are incremented by unique actions
<p>Any time a user interacts with an object tagged with a particular action name, the initial interaction is logged as one <em>unique event</em>
for that action name. Any additional interaction with the same action
trigger for that user's session will not contribute to the unique event
calculation for that particular action. This is true even if the user
leaves that object and begins to interact with another object tagged via
the same action name. <br>
<br>
This has two notable results in the reports. First,
suppose a user interacts with the "Play" action from two unique video
players tagged with separate categories. The <em>Top Actions</em> reports for "Play" will list one unique event even though the user engaged with two unique players. Secondly, each category's <em>Action</em> report will list one unique action, since there is indeed one unique event per category/action pair. See <a href="#Count">Implicit Count</a> for more information.</p>
</li>
</ul>
<div align="right"><a href="#top" class="backtotop">Back to Top</a></div>
<h3><a name="Labels" id="Labels"></a>Labels</h3>
<p>The term "Label" in the Event Tracking data model refers to the third string parameter in the <code>_trackEvent()</code>
method. This parameter is optional. With labels, you can provide
additional information for events that you want to track, such as the
movie title in the video examples above, or the name of a file when
tracking downloads. </p>
<pre>pageTracker._trackEvent('Downloads', 'PDF', '/salesForms/orderForm1.pdf');</pre>
<p>As with Categories and Actions, the reporting interface has its
own section for all labels you create for your Event Tracking. Think of a
label as a way to create an additional reporting dimension for user
interaction with page objects. For example, suppose you have five video
players on your page that you want to track interaction with. Each one
of these players can use the "Videos" category with the "Play" action,
but each could also have a separate label (such as the movie name) so
that they appear as distinct elements in the report. </p>
<pre>_gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);
_gaq.push(['_trackEvent', 'Videos', 'Play', 'Huckleberry Finn']);</pre>
<h3><a name="Values" id="Values"></a>Values</h3>
<p>The term "Value" refers to the fourth, and optional, parameter that you can use with the <code>_trackEvent() </code>method. This parameter differs from the others in that it is of type <code>integer</code> rather than <code>string</code>,
so 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. </p>
<pre>_gaq.push(['_trackEvent', 'Videos', 'Video Load Time', 'Gone With the Wind', downloadTime]);</pre>
<p>The value is interpreted as a number and the report adds the total
values based on each event count (see <a href="#Count">Implicit Count</a> below).
The report also determines the average value for the category. In the example
above, the <code>_trackEvent()</code> method is called for the "Video
Load Time" action when video load completes. The name of the video
is provided as a label, and the computed load time is accrued for each
video download. You could then determine average load time for all "Video
Load Time" actions for the "Videos" category. Suppose you
had 5 unique downloads for your website videos with download times in seconds
as:</p>
<ul>
<li>10</li>
<li>25</li>
<li>8</li>
<li>5</li>
<li>5</li>
</ul>
<p>The reporting interface would then compute these as follows, with
the numbers in this example illustrating download time in seconds: </p>
<table border="1" width="320">
<tbody><tr>
<th scope="col"># Visits w/Events </th>
<th scope="col">Value</th>
<th scope="col">Average Value </th>
</tr>
<tr>
<td>5</td>
<td>53</td>
<td>10.6</td>
</tr>
</tbody></table>
<p class="note">Negative integers are not supported at this time.</p>
<h3 id="Count">Implicit Count</h3>
<p>In Event Tracking, each interaction with a tracked web page
object is counted, and each interaction is associated with a given user
session. In the reports, Total Events are calculated as the total number
of interactions with a tracked web page object. On the other hand,
where a single user session (or visit) has one or more events, this is
calculated as a single <em>Visit w/Event</em>, or <em>Unique Event</em> in the reports.</p>
<p>For example, if one user clicks the same button on a video 5
times, the total number of events associated with the video is 5, and
the number of unique events is 1.</p>
<p>The following table illustrates how data is aggregated in the
reporting interface for a given event category. In this example, the
same category name is called from 2 separate video players, each with a
distinct label. These players share the actions "Play" and "Stop," as
programmed in the Flash UI for the video player. </p>
<p></p><table border="1" width="600">
<caption>
Event tracking
for "Videos" category
</caption>
<tbody><tr>
<th scope="col">Action Type </th>
<th scope="col">Label: "Gone With the Wind" </th>
<th scope="col">Label: "Mr Smith Goes to Washington" </th>
<th scope="col">Totals</th>
</tr>
<tr>
<td scope="row">Play</td>
<td>10 visits w/Event</td>
<td>5 visits w/Event </td>
<td>15 unique events "Play" </td>
</tr>
<tr>
<td scope="row">Pause</td>
<td>2 visits w/Event </td>
<td>8 visits w/Event</td>
<td>10 unique events "Pause" </td>
</tr>
<tr>
<td scope="row">Stop</td>
<td>2 visits w/Event </td>
<td>3 visits w/Event </td>
<td>5 unique events "Stop" </td>
</tr>
<tr>
<th>Totals</th>
<td>14 unique events for GWTW </td>
<td>16 unique events for Mr Smith</td>
<td>30 unique events for category "videos" </td>
</tr>
</tbody></table>
<p>The table above makes the assumption that user interaction with
"Gone With the Wind" and "Mr Smith Goes to Washington" occurs
independently in separate user sessions (visits). However, the table
below illustrates how events are calculated for a given action in a more
complex and typical scenario, where some users press "Play" on only one
video, while others interact with more than one video during a visit.
Here, the total unique events reflects the total unique events for the
"Play" action across labels. Notice that, even though there are 17
unique events per label/action pair, the reports list the unique events
for the relevant dimension. So, for all actions, there are only 16
unique events, and for the "Videos" category, a total of 16 visits
included an event in which "Videos" was the category.</p>
<p></p><table border="1" width="600">
<caption>
Event Tracking Calculation for "Play" Action
</caption>
<tbody><tr>
<th scope="col">Action Type </th>
<th scope="col">Label: "Gone With the Wind" </th>
<th scope="col">Label: "Mr Smith Goes to Washington" </th>
<th scope="col">Totals</th>
</tr>
<tr>
<td scope="row">Play</td>
<td>10 visits w/event</td>
<td>&nbsp;</td>
<td>10 unique events "Play" </td>
</tr>
<tr>
<td scope="row">Play</td>
<td>&nbsp;</td>
<td>5 visits w/event</td>
<td>5 unique events "Play"</td>
</tr>
<tr>
<td scope="row">Play</td>
<td colspan="2">1 visit w/event on BOTH movies (two clicks on "Play")</td>
<td>1 unique event "Play"</td>
</tr>
<tr>
<th>Totals</th>
<td>11 unique play events for GWTW </td>
<td>6 unique play events for Mr Smith</td>
<td>16 unique events for category "Videos" and 16 unique events for action "Play"</td>
</tr>
</tbody></table>
<h2 id="implementationConsiderations">Implementation Considerations</h2>
<p>Keep in mind the following when implementing Event Tracking for your site.</p>
<h3>Bounce Rate Impact</h3>
<p>In general, a "bounce" is described as a single-page visit to your
site. In Analytics, a bounce is calculated specifically as a session
that triggers only a single GIF request, such as when a user comes to a
single page on your website and then exits without causing any other
request to the Analytics server for that session. However, if you
implement Event Tracking for your site, you might notice a change in
bounce rate metrics for those pages where Event Tracking is present.
This is because Event Tracking, like page tracking is classified as an
interaction request.</p>
<p>For example, suppose you have a page with a video player where the
bounce rate is historically high, and you have not implemented Event
Tracking for the page. If you subsequently set up Event Tracking for
the player, you might notice a decrease in the bounce rate for that
page, because Analytics will record user interaction with the player and
send that interaction to the server as an additional GIF request.
Thus, even though the same percentage of visitors to the page might
still exit without viewing any other page on your site, their
interaction with the video player triggers Event Tracking calls, which
disqualifies their visit as a bounce.</p>
<p>In this way, "bounces" for your event-enabled pages means something
slightly different: a single-page visit that includes no user
interaction on tracked events.</p>
<p class="note">It's important to keep in mind that any implementation
of Event Tracking that automatically executes on page load will result
in a zero bounce rate for the page. This is the case if you implement
the <a href="http://code.google.com/apis/analytics/docs/tracking/eventTrackerWrappers.html">TimeTracker</a> example, or any other similar Event Tracking utility.</p>
<h3>Events Per Session Limit </h3>
<p>For each visit (user session), a maximum of approximately 500
combined GATC requests (both events and page views) can be tracked. Keep
this in mind when programmatically generating events. Note that—as the
number of events in a session approaches the limit—additional events
might not be tracked. For example, you should:</p>
<ul>
<li> avoid scripting a video to send an event for every second played and other highly repetitive event triggers </li>
<li>avoid excessive mouse movement tracking</li>
<li>avoid time-lapse mechanisms that generate high event counts</li>
</ul>
<p>For more background information on sessions, see the <a href="http://www.google.com/support/analytics/bin/answer.py?answer=33073">Google Analytics Help Center on this topic</a>. </p>
<div align="right"><a href="#top" class="backtotop">Back to Top</a></div>
<div style="height: 5035px;" id="gc-collapsible"></div></div><!-- end gc-pagecontent -->
</div><!-- end gooey wrapper -->
</div> <!-- end codesite content -->
<div id="gc-footer" dir="ltr">
<div class="text">
©2011 Google -
<a href="http://code.google.com/">Code Home</a> -
<a href="http://code.google.com/terms.html">Terms of Service</a> -
<a href="http://code.google.com/privacy.html">Privacy Policy</a> -
<a href="http://code.google.com/more/">Site Directory</a>
<br> <br>
Google Code offered in:
<a href="http://code.google.com/intl/en/">English</a> -
<a href="http://code.google.com/intl/es/">Español</a> -
<a href="http://code.google.com/intl/ja/">日本語</a> -
<a href="http://code.google.com/intl/ko/">한국어</a> -
<a href="http://code.google.com/intl/pt-BR/">Português</a> -
<a href="http://code.google.com/intl/ru/">Pусский</a> -
<a href="http://code.google.com/intl/zh-CN/">中文(简体)</a> -
<a href="http://code.google.com/intl/zh-TW/">中文(繁體)</a>
</div>
</div><!-- end gc-footer -->
</div><!-- end gc-container -->
<script type="text/javascript">CODESITE_CSITimer['load'].tick('ats');</script>
<script src="06_eventTrackerGuide-Dateien/codesite_tail.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(
['projectTracker._setAccount', 'YT-8705592-1'],
['projectTracker._setDomainName', 'code.google.com'],
['projectTracker._setCookiePath', window.location.pathname.substring(0,
window.location.pathname.lastIndexOf('/') + 1)],
['projectTracker._trackPageview'],
['siteTracker._setAccount', 'UA-18071-1'],
['siteTracker._setDomainName', 'code.google.com'],
['siteTracker._setCookiePath', window.location.pathname.substring(0,
window.location.pathname.lastIndexOf('/') + 1)],
['siteTracker._trackPageview']
);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = 'http://www.google-analytics.com/ga.js';
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(ga);
})();
</script>
<div style="display: none;" id="menuDiv-lang-dropdown" class="menuDiv instance0"><div class="menuCategory default"><a href="http://code.google.com/intl/en/apis/analytics/docs/tracking/eventTrackerGuide.html" style="display: block;" class="menuItem">English</a><a href="http://code.google.com/intl/es/apis/analytics/docs/tracking/eventTrackerGuide.html" style="display: block;" class="menuItem">Español</a><a href="http://code.google.com/intl/ja/apis/analytics/docs/tracking/eventTrackerGuide.html" style="display: block;" class="menuItem">日本語</a><a href="http://code.google.com/intl/ko/apis/analytics/docs/tracking/eventTrackerGuide.html" style="display: block;" class="menuItem">한국어</a><a href="http://code.google.com/intl/pt-BR/apis/analytics/docs/tracking/eventTrackerGuide.html" style="display: block;" class="menuItem">Português (Brasil)</a><a href="http://code.google.com/intl/ru/apis/analytics/docs/tracking/eventTrackerGuide.html" style="display: block;" class="menuItem">Pусский</a><a href="http://code.google.com/intl/zh-CN/apis/analytics/docs/tracking/eventTrackerGuide.html" style="display: block;" class="menuItem">中文 (简体)</a><a href="http://code.google.com/intl/zh-TW/apis/analytics/docs/tracking/eventTrackerGuide.html" style="display: block;" class="menuItem">中文 (繁體)</a></div></div><div id="gc-collapsible-arrow"></div><div id="cs-searchresults"><div id="cs-recommended">Suggestions</div><div id="searchResult1"></div><div id="searchResult2"></div><div id="searchResult3"></div><div id="searchResult4"></div><div id="searchResult5"></div><div id="searchResult6"></div><div id="searchResult7"></div></div><div style="display: none;" id="menuDiv-projects-dropdown" class="menuDiv instance1"><div class="menuCategory controls"><hr class="menuSeparator"><a href="http://code.google.com/more/" style="display: block;" class="menuItem">Find developer products...</a><a href="http://code.google.com/hosting/" style="display: block;" class="menuItem">Find open source projects...</a></div></div></body></html>