Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 35

New Google Analytics Code

This is a discussion on New Google Analytics Code within the General Discussion forums, part of the vBSEO SEO Plugin category; I've put this here rather than troubleshooting because the new code is not officially part of vBSEO 'yet' (but I ...

  1. #1
    Senior Member woostar's Avatar
    Real Name
    woostar
    Join Date
    Apr 2007
    Posts
    786
    Liked
    5 times

    New Google Analytics Code

    I've put this here rather than troubleshooting because the new code is not officially part of vBSEO 'yet' (but I notice that it has been implemented on this forum) so is just a preemptive strike.

    Since installing the new Analytics code I've noticed that the registration goal conversions are no longer tracking.

    Anyone else tried installing the code and noticed this?
    2011 Average: 1 post every 5 seconds... 24/7

  2. #2
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    22,367
    Liked
    542 times
    Blog Entries
    4
    The new Analytics code will be implemented within the new version. However if you want to implement it right now please do the following :

    You can modify functions_vbseo.php file for that.

    Find
    PHP Code:
    $newtext preg_replace('#(</body>)#is','
    <script src="'
    .((($_SERVER['HTTPS'] && $_SERVER['HTTPS']!='off')||isset($_SERVER['HTTP_FRONT_END_HTTPS']))?'https://ssl':'http://www').'.google-analytics.com/urchin.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "'
    .VBSEO_ANALYTICS_CODE.'";
    urchinTracker();
    </script>
    '
    .'\\1',$newtext,1); 
    REPLACE WITH:

    HTML Code:
                          $newtext = preg_replace('#(</body>)#is','
    <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("'.VBSEO_ANALYTICS_CODE.'");
    pageTracker._initData();
    pageTracker._trackPageview('.($track_url?"'$track_url'":"").');
    </script>
    '.'\\1',$newtext,1);
    Last edited by Oleg Ignatiuk; 03-22-2008 at 04:49 AM.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  3. #3
    Senior Member woostar's Avatar
    Real Name
    woostar
    Join Date
    Apr 2007
    Posts
    786
    Liked
    5 times
    Hi Mert

    I posted about it a few days ago (Google Analytics has a new tracker?) but I've found that since doing it it no longer tracks registrations (using the funnel).

    Any ideas?
    2011 Average: 1 post every 5 seconds... 24/7

  4. #4
    wld
    wld is offline
    Member wld's Avatar
    Real Name
    Milan
    Join Date
    Feb 2008
    Location
    New York
    Posts
    88
    Liked
    0 times

    Question

    Quote Originally Posted by Mert Gökçeimam View Post
    The new Analytics code will be implemented within the new version. However if you want to implement it right now please do the following :

    You can modify functions_vbseo.php file for that.

    Find
    PHP Code:
    $newtext preg_replace('#(</body>)#is','
    <script src="'
    .((($_SERVER['HTTPS'] && $_SERVER['HTTPS']!='off')||isset($_SERVER['HTTP_FRONT_END_HTTPS']))?'https://ssl':'http://www').'.google-analytics.com/urchin.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "'
    .VBSEO_ANALYTICS_CODE.'";
    urchinTracker();
    </script>
    '
    .'\\1',$newtext,1); 
    REPLACE WITH:

    PHP Code:
                $newtext preg_replace('#(</body>)#is','
    <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("'
    .VBSEO_ANALYTICS_CODE.'");
    pageTracker._initData();
    pageTracker._trackPageview('
    .($track_url?"'$track_url'":"").');
    </script>
    '
    .'\\1',$newtext,1); 
    Quote Originally Posted by woostar View Post
    Hi Mert

    I posted about it a few days ago (Google Analytics has a new tracker?) but I've found that since doing it it no longer tracks registrations (using the funnel).

    Any ideas?


    Hi -- I have replaced the old Analytics code with the new one, but I'm getting an error message ("Done, but with errors on page") on pages which are used for a user registration... apparently due to the Google Analytics script on the page.

    Affected pages (scripts) are:

    1) forum/register.php
    2) forum/register.php?do=register
    3) forum/register.php?do=addmember


    Note: This problem only appears when viewing pages in Internet Explorer, in FireFox it doesn't show any errors.


    UPDATE:

    I can see the "urchinTracker" code below the new Analytics code on those pages used for the registration. Could that be the problem? I don't see any urchinTracker code on the other pages.


    <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("UA-XXXXXXX-1");
    pageTracker._initData();
    pageTracker._trackPageview();
    </script>

    <script type="text/javascript">
    urchinTracker("/google-funnel/agreement.html")
    </script>


    Any help appreciated !!



    UPDATE:

    When I deleted the "urchinTracker" code from the scripts mentioned above all error messages disappeared. I think "pageTracker._trackPageview" inside the new Google Analytics code replaced the function of the old urchinTracker code and they can not be placed together on the same script page.
    Last edited by wld; 03-12-2008 at 12:37 PM.

  5. #5
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    anybody else having problems with this?

    i install the code change and i just get white pages on my site.

  6. #6
    Member
    Real Name
    Frank
    Join Date
    Sep 2007
    Location
    Taiwan
    Posts
    42
    Liked
    0 times
    no problems here.

    You seeing anything in your error.log file?

  7. #7
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    The urchinTracker(XX) code should be repalced with pageTracker._trackPageview(XX) in this case as well.
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  8. #8
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    I was referring to Mert's code post, not the extra urchinTracker() stuff.

    Nothing in the error log.

  9. #9
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Looks like there are a couple of slashes missing there (vB parser removes them for some reason), here is the code:
    HTML Code:
                $newtext = preg_replace('#(</body>)#is','
    <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("'.VBSEO_ANALYTICS_CODE.'");
    pageTracker._initData();
    pageTracker._trackPageview('.($track_url?"'$track_url'":"").');
    </script>
    '.'\\1',$newtext,1);
    Last edited by Oleg Ignatiuk; 03-21-2008 at 12:10 PM.
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  10. #10
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    22,367
    Liked
    542 times
    Blog Entries
    4
    Quote Originally Posted by Oleg Ignatiuk View Post
    Looks like there are a couple of slashes missing there (vB parser removes them for some reason), here is the code:
    HTML Code:
                $newtext = preg_replace('#(</body>)#is','
    <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("'.VBSEO_ANALYTICS_CODE.'");
    pageTracker._initData();
    pageTracker._trackPageview('.($track_url?"'$track_url'":"").');
    </script>
    '.'\\1',$newtext,1);
    The edit breaks page validation
    Last edited by Oleg Ignatiuk; 03-21-2008 at 12:09 PM.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  11. #11
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Do you mean html validation (which page)?
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  12. #12
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    22,367
    Liked
    542 times
    Blog Entries
    4
    Breaks validation at showthread pages

    [Invalid] Markup Validation of http://www.ayyas.com/guncel-olaylar/22057-gene/ - W3C Markup Validator

    If i use the old analytics code everything is ok
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  13. #13
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Please try to enclose js code in html comment:
    HTML Code:
    <script language="Javascript"><!--
    ...
    //-->
    </script>
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  14. #14
    Junior Member
    Real Name
    Carsten
    Join Date
    Mar 2008
    Posts
    13
    Liked
    0 times
    I get a plank page after changing the code. Can you please exact post which code I should be replaced with which code?

  15. #15
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    The instruction is included in post#2 above: New Google Analytics Code
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Need to add advanced _udn into Google Analytics Code
    By Zip-Lock in forum Analysis: Traffic & SERPS
    Replies: 1
    Last Post: 03-22-2007, 09:13 PM
  2. Got My Google Analytics code today
    By shanemcse in forum Analysis: Traffic & SERPS
    Replies: 10
    Last Post: 11-15-2006, 12:07 AM
  3. How do I add the Google Analytics Code?
    By Lammypie in forum General Discussion
    Replies: 10
    Last Post: 05-22-2006, 09:08 PM
  4. 2.2.2/2.3.0 Google Analytics Code
    By Keith Cohen in forum Bug Reporting
    Replies: 4
    Last Post: 12-08-2005, 01:11 PM
  5. Finding my Google Analytics Code
    By Michael in forum Troubleshooting
    Replies: 1
    Last Post: 11-21-2005, 04:24 PM

Posting Permissions

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