22 web analytics__track_pageview_in_async

6
Google Analytics Adv - Accounts _trackPageview in Async

description

Web analytics in small bites. A 2 minutes video on _trackPageview the "workhorse" for Google Analytics

Transcript of 22 web analytics__track_pageview_in_async

Page 1: 22 web analytics__track_pageview_in_async

Google Analytics Adv - Accounts_trackPageview in Async

Page 2: 22 web analytics__track_pageview_in_async

_trackPageview  is the primary function for tracking a page within Google Analytics.

_trackPageview sets up all the necessary cookies for the session and submits the data to the Google servers.

There are basically 5 cookies that are set.

_trackPageview in Async

<script type="text/javascript">

  var _gaq = _gaq || [];  _gaq.push(['_setAccount', 'UA-1234567-1']);  _gaq.push(['_trackPageview']);

  (function() {    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);  })();

</script>

Page 3: 22 web analytics__track_pageview_in_async

The five cookie names and types that Google Analytics uses are:

__utma__utmb__utmc__utmv__utmz

The blue table defines each ones specific function regarding tracking.

_trackPageview in Async

Page 4: 22 web analytics__track_pageview_in_async

You can view these cookie values in the preference settings of your browser, normally in the privacy tab.

1.  Notice that all values are preceded by a hash of the host.domain. the Async is located on.

The hash value is a fixed length numerical value (9 in this case) that represents your website.

The hash values for sites will be 9 digits in this case regardless of the domain name length.

_trackPageview in Async

1

Page 5: 22 web analytics__track_pageview_in_async

The domain-hashing functionality in Google Analytics uses the (9 digit) hash number to check cookie integrity for visitors on a domain.

However, to track visitors who cross:

Subdomainsor

Other 3rd party domains you control

you need to turn off domain hashing so the cookie integrity check will not reject a user cookie coming from one domain to another.

These are special cases, but worth being aware of.

_trackPageview in Async

www.myownsite.comsupport.myownsite.com

www.myownsite.comsupport.myownsite.co.au

Multiple subdomains

3rd party domains you control

Page 6: 22 web analytics__track_pageview_in_async

GOOGLE ANALYTICS Adv - Accounts

Today we covered:_trackPageview  in Async

Contact me for more information on any item in the series.

[email protected]