Awais Qarni
Awais Qarni

Reputation: 18016

Google analytics page view track

Hi there I am doing research on google anlytics. I have got the following code from google analytics

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'XXXXX']);
_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);
})();    

It has only _trackPageview parameter. Will the above code will automatically track the keyword whether it is organic or paid from any data source or campaign Or I need to send some custom parameter for it?

Upvotes: 0

Views: 125

Answers (1)

Eike Pierstorff
Eike Pierstorff

Reputation: 32780

The code recognizes organic, referal and direct traffic automatically. If you have adwords campaigns you can set them to "autotagging" in the adwords interface and campaign info will be appended automatically. For everything else there utm parameters - Google provides a handy tool to create click urls with parameters here: https://support.google.com/analytics/answer/1033867?hl=en

If you don't add autotagging or utm paramaters to your cpc campaigns they will be lumped together with organic search traffic.

Upvotes: 1

Related Questions