GoogleServices/Sources/doku/06_eventTrackerGuide-Dateien/custom_tracker_min.js

12 lines
4.7 KiB
JavaScript
Raw Normal View History

2011-02-27 00:25:02 +01:00
var _gaq=_gaq||[],_cTr=_cTr||{};_cTr.areaTracker=_cTr.areaTracker||{};
_cTr.areaTracker=function(){var f=function(b,d,c){return function(a){b&&b();a=a?a.target:window.event.srcElement;if(a.nodeType==3)a=a.parentNode;a.tagName=="A"&&h(a.href,d,a.innerHTML,c);return false}},h=function(b,d,c,a){_gaq.push(["projectTracker._trackEvent",d,c]);if(a){b=["url=",b,"\ncategory=",d,"\naction=",c].join("");try{console.log(b)}catch(e){alert(b)}}else setTimeout('document.location = "'+b+'"',100)};return{trackElement:function(b,d,c){c=c||false;if(b=document.getElementById(b))b.onclick=
f(b.onclick,d,c);return this}}}();_gaq=_gaq||[];_cTr=_cTr||{};_cTr.timeTracker=_cTr.timeTracker||{};
_cTr.timeTracker=function(){var f=function(d,c,a,e){return function(){if(e){var g=["\ncategory=",d,"\naction=",c,"\nlabel=",a].join("");try{console.log(g)}catch(i){alert(g)}}else _gaq.push(["projectTracker._trackEvent",d,c,a])}},h=function(d){return Math.round(d/600)/100+"m"},b=function(){return document.location.pathname.split("/").pop().split(".")[0]};return{trackTime:function(d,c,a,e,g){c=c||"Time On Page";a=a||b();e=e||h(d);window.setTimeout(f(c,a,e,g||false),d);return this}}}();_cTr=_cTr||{};_cTr.trackingDefs=_cTr.trackingDefs||{};_cTr.trackTime=_cTr.timeTracker.trackTime;_cTr.trackElement=_cTr.areaTracker.trackElement;
_cTr.trackingDefs={asyncMigrationExamples:function(){_cTr.trackElement("toc-list","Async Migration Examples")},asyncTracking:function(){_cTr.trackElement("toc-list","Async Tracking Main").trackTime(3E5).trackTime(6E5).trackTime(9E5)},asyncUsageGuide:function(){_cTr.trackElement("toc-list","Async Usage Guide").trackTime(3E5).trackTime(6E5).trackTime(9E5)},commonTasks:function(){_cTr.trackElement("toc-list","GWO Common Tasks Links")},eventTrackerGuide:function(){_cTr.trackElement("toc-list","Event Tracking Links")},
gaConceptsAccounts:function(){_cTr.trackElement("toc-list","Accounts and Profiles").trackTime(3E5).trackTime(6E5).trackTime(9E5)},gaConceptsOverview:function(){_cTr.trackElement("toc-list","Functional Overview").trackTime(3E5).trackTime(6E5).trackTime(9E5)},gaConceptsSampling:function(){_cTr.trackElement("toc-list","Sampling").trackTime(3E5).trackTime(6E5).trackTime(9E5)},gaJSApi:function(){_cTr.trackElement("toc-list","Tracking API Links").trackElement("gaq-object-list","Tracking API Links").trackElement("gaq-object-list",
"Tracking API Links")},gaTrackingCustomVariables:function(){_cTr.trackElement("toc-list","Custom Variables Links").trackElement("use-case-list","Custom Variables Links").trackElement("usage-list","Custom Variables Links")},gaTrackingSite:function(){_cTr.trackElement("toc-list","Cross Domain Tracking")},gaTrackingTraffic:function(){_cTr.trackElement("toc-list","Traffic Sources Links").trackElement("camp-tracking-list","Traffic Sources Links").trackElement("campaign-methods-general","Traffic Sources Links").trackElement("campaign-methods-custom",
"Traffic Sources Links")},gdataAnalyticsAdWords:function(){_cTr.trackElement("toc-list","Analytics and AdWords article").trackTime(3E5).trackTime(6E5).trackTime(9E5)},gdataArticlesCode:function(){_cTr.trackElement("user-contributed-articles-list","Articles Links User Contributed").trackElement("ga-contributed-articles-list","Articles Links GA Contributed")},gdataLibraries:function(){_cTr.trackElement("supported-libs-list","Supported Libraries Links").trackElement("google-data-libs-list","Google Data Libraries Links").trackElement("user-contributed-libs-list",
"User Contributed Libraries Links")},gdataJava:function(){_cTr.trackElement("toc-list","Export API Java TOC").trackElement("prereq-list","Export API Java External Resources").trackElement("environment-list","Export API Java External Resources").trackElement("auth-list-1","Export API Java External Resources").trackElement("auth-list-2","Export API Java External Resources").trackElement("samples-list","Export API Java External Resources").trackElement("samples-list-2","Export API Java External Resources").trackElement("error-handling-list",
"Export API Java External Resources")},gdataJavascript:function(){_cTr.trackElement("toc-list","Export API Javascript Links").trackElement("samples-list","Export API Javascript Links").trackElement("libraries-list","Export API Javascript Links").trackElement("resources-list","Export API Javascript Links")},gdataProtocol:function(){_cTr.trackElement("toc-list","Export API Protocol Links")},gdataReferenceCommonCalculations:function(){_cTr.trackElement("toc-list","Common Calculations Links")},gdataReferenceDimensionsMetrics:function(){_cTr.trackElement("toc-list",
"Dimensions Metrics Links")}};_cTr=_cTr||{};_cTr.init=function(){var f=document.location.pathname.split("/").pop().split(".")[0];_cTr.trackingDefs[f]()};$(document).ready(function(){_cTr.init()});