SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    May 2012
    Location
    Tampa, Florida, United States
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Traffic Dropped After Adding Google Analytics Subdomain Tracking

    Hello,

    I need to be able to separate the Google Analytics reporting on my site in the following ways:

    1. Full tracking for www.example.com
    2. Track support.example.com subdomain in a profile under the main site

    Yesterday, I replaced the traditional tracking code with the following modified code:

    <script type="text/javascript">

    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

    </script>

    <script type="text/javascript">

    var pageTracker = _gat._getTracker("US-XXXXXXX-X");

    pageTracker._setDomainName(".example.com");

    pageTracker._addIgnoredRef(".example.com");

    pageTracker._trackPageview();

    </script>

    Since I added this code, ONLY the organic search traffic from Google has decreased, and by 83%. I have never tracked a subdomain before and there was a lot of older material online about how to do it, because apparently Google's own code is messed up. Can anyone provide any insight as to why this drop in organic traffic may have occured? Any ideas for a fix? I'd really appreciate any and all advice.
    Last edited by TechnoBear; May 24, 2012 at 08:55. Reason: Example URL delinkified

  2. #2
    SitePoint Member
    Join Date
    May 2012
    Location
    Tampa, Florida, United States
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nobody has any suggestions, insights, ideas?

  3. #3
    SitePoint Zealot topgrade's Avatar
    Join Date
    Jun 2007
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure but the drop in traffic should not be due to adding this code. To verify it just remove this code and check if the traffic starts increasing again. If not then there could be some other problem but not the code.
    DoFollow Backlink Checker | Internet Marketing and SEO Forums

    22,000+ List of Directories to submit your site. List of Blogs, Forums, Press Release, Social Media... (sort by PR & Alexa)

  4. #4
    Non-Member
    Join Date
    May 2012
    Location
    India
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I used this code for tracking.Try this code

    <script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-xxxxxxxx-x']);
    _gaq.push(['_setDomainName', '.example.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>


    Hope this will help

    Quote Originally Posted by KaloVast View Post
    Hello,

    I need to be able to separate the Google Analytics reporting on my site in the following ways:

    1. Full tracking for www.example.com
    2. Track support.example.com subdomain in a profile under the main site

    Yesterday, I replaced the traditional tracking code with the following modified code:

    <script type="text/javascript">

    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

    </script>

    <script type="text/javascript">

    var pageTracker = _gat._getTracker("US-XXXXXXX-X");

    pageTracker._setDomainName(".example.com");

    pageTracker._addIgnoredRef(".example.com");

    pageTracker._trackPageview();

    </script>

    Since I added this code, ONLY the organic search traffic from Google has decreased, and by 83%. I have never tracked a subdomain before and there was a lot of older material online about how to do it, because apparently Google's own code is messed up. Can anyone provide any insight as to why this drop in organic traffic may have occured? Any ideas for a fix? I'd really appreciate any and all advice.

  5. #5
    SitePoint Member vcarecorporation's Avatar
    Join Date
    May 2012
    Location
    Seattle
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    May be your modification and updation is not like Google Analytics Code.Why don't you changed it with original one.

  6. #6
    SitePoint Zealot nacworld's Avatar
    Join Date
    Aug 2008
    Location
    TEXAS
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have 2 analytics url account for same domain? Maybe the traffic has splitted to 2 domains...


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •