user1373287
user1373287

Reputation: 53

Will Google Analytics code for main domain pages and sub-domain be same?

HI Here is my code: Will this code go into all the pages of my website. I know It should go into all pages of the subdomain of my website.

<script type="text/javascript">

  var _gaq = _gaq || [];

  _gaq.push(['_setAccount', 'UA-*******']);

  **_gaq.push(['_setDomainName', 'tuneupmedia.com']);**

  _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>

Upvotes: 2

Views: 202

Answers (1)

Yahel
Yahel

Reputation: 37305

Yes. That code should be placed on all your pages, with the same _setDomainName value.

Upvotes: 1

Related Questions