Results 1 to 15 of 15

extend Google Analytics Code

This is a discussion on extend Google Analytics Code within the Analysis: Traffic & SERPS forums, part of the vBulletin SEO Discussion category; Hi, I did already ask this in the german subforum, but didn't get any answer (yet). How can I extend ...

  1. #1
    Junior Member
    Real Name
    Valentin
    Join Date
    Jan 2009
    Posts
    4
    Liked
    0 times

    Question extend Google Analytics Code

    Hi,

    I did already ask this in the german subforum, but didn't get any answer (yet).

    How can I extend the Google Analytics tracking code which is implemented by vbSEO?

    Greetings
    Valentin

  2. #2
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,777
    Liked
    647 times
    Blog Entries
    2
    What exactly are you looking to do?
    Brian Cummiskey / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  3. #3
    Junior Member
    Real Name
    Valentin
    Join Date
    Jan 2009
    Posts
    4
    Liked
    0 times
    Quote Originally Posted by Brian Cummiskey View Post
    What exactly are you looking to do?
    I would like to add some custom variables: Custom Variables - Google Analytics - Google Code

  4. #4
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,777
    Liked
    647 times
    Blog Entries
    2
    You options are to
    a) edit includes/functions_vbseo.php to include the code (makes upgrading a pain)
    b) create a new plugin with an execution order LOWER than vbseo and likely the global_complete hook if its a global change, else you'll need to make a plugin for each xxxx_compelte hook (so it goes before it) and put the info you need into $more_tracking2 variable, as in
    Code:
    $more_tracking2 .= "\n".'pageTracker._trackPageview();';
    Brian Cummiskey / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  5. #5
    Junior Member
    Real Name
    J S
    Join Date
    Jan 2008
    Posts
    12
    Liked
    0 times
    Hi,
    The file includes/functions_vbseo.php is not included in the 3.5 version. Were do I find the Google Analytics script in this version? I need to add this code to it:
    Code:
    pageTracker._setDomainName(".ourdomain.com");

  6. #6
    Senior Member
    Real Name
    Ceri May
    Join Date
    Jul 2009
    Location
    United Kingdom
    Posts
    1,726
    Liked
    15 times
    Blog Entries
    1
    Hi Jon,

    All off the files have been moved into their own folder try

    vbseo/includes/functions_vbseo.php

    Ceri

  7. #7
    Junior Member
    Real Name
    J S
    Join Date
    Jan 2008
    Posts
    12
    Liked
    0 times
    I found the file, thank you.

    But I can't find were to add my string to the actual Google Analytics script. I'm not sure this shall be done it that file. Where can I add my extended code!?

  8. #8
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,777
    Liked
    647 times
    Blog Entries
    2
    see post #4 above.

    .= on the variable 'continuies' the variable. You're adding a line break (\n), and then your tracker code
    Brian Cummiskey / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  9. #9
    Junior Member
    Real Name
    J S
    Join Date
    Jan 2008
    Posts
    12
    Liked
    0 times
    Ok, so our additional tracking code should look like this?:
    $more_tracking2 .= "\n".'pageTracker._setDomainName(".ourdomain.com") ;';

    We're using version 3.5. Could you please tell me exactly where in /vbseo/includes/functions_vbseo.php I shall place this code?

  10. #10
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,777
    Liked
    647 times
    Blog Entries
    2
    3.5 uses the new ajax style analytics and is slightly different call method

    around line 2169 find


    Code:
    vbseo_insert_code("
    <script type=\"text/javascript\"><!--
    var _gaq = _gaq || [];
    _gaq.push(
    " . implode(",\n", $more_tracking) ."
    );
    add above: (UNTESTED)

    Code:
    //add on domain extra code
    $more_tracking[] = "['_setDomainName', 'foo.com']";
    Brian Cummiskey / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  11. #11
    Junior Member afloresm's Avatar
    Real Name
    Alejandro Flores
    Join Date
    May 2008
    Posts
    3
    Liked
    0 times
    Hello,

    I think it could be a great feature for new releases to be able of changing the default analytics tracking code from de vbSEO panel.

  12. #12
    Junior Member
    Real Name
    GEORGE
    Join Date
    May 2008
    Location
    Brisbane, Australia
    Posts
    22
    Liked
    1 times
    Quote Originally Posted by Brian Cummiskey View Post
    3.5 uses the new ajax style analytics and is slightly different call method

    around line 2169 find


    Code:
    vbseo_insert_code("
    <script type=\"text/javascript\"><!--
    var _gaq = _gaq || [];
    _gaq.push(
    " . implode(",\n", $more_tracking) ."
    );
    add above: (UNTESTED)

    Code:
    //add on domain extra code
    $more_tracking[] = "['_setDomainName', 'foo.com']";
    Hi Brian how would this play out if I also want to use 3.5 and asynchronous tracking Asynchronous Tracking - Google Analytics - Google Code ? would final 3.5 version support both features out of the box for subdomain tracking + asynchronous tracking ?

    for subdomains Asynchronous Tracking Usage Guide - Google Analytics - Google Code

  13. #13
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,777
    Liked
    647 times
    Blog Entries
    2
    3.5 already uses the async tracking method.

    virtual domain support is coming with 3.5 gold.
    Brian Cummiskey / 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
    GEORGE
    Join Date
    May 2008
    Location
    Brisbane, Australia
    Posts
    22
    Liked
    1 times
    thanks Brian

  15. #15
    Junior Member
    Real Name
    Hoover5555
    Join Date
    Jan 2008
    Posts
    1
    Liked
    0 times
    Tracking API: Basic Configuration - Google Analytics - Google Code

    _setVar is depreciated. Please use
    _setCustomVar instead in functions_vbseo.php

    Furthermore provide an interface in the control panel to let the admin decide how to name that variable. Otherwise it might collide with other values that the admin has set for non-forum pages.

Similar Threads

  1. Adding (legacy) Urchin code to Google Analytics Code
    By Nut65 in forum General Discussion
    Replies: 6
    Last Post: 11-18-2009, 09:42 AM
  2. Google Analytics: Where do I put the code?
    By Metalgearsolid_x in forum General Discussion
    Replies: 13
    Last Post: 11-10-2009, 06:34 AM
  3. New Google Analytics Code
    By woostar in forum General Discussion
    Replies: 34
    Last Post: 05-11-2008, 07:01 AM
  4. How do I add the Google Analytics Code?
    By Lammypie in forum General Discussion
    Replies: 10
    Last Post: 05-22-2006, 09:08 PM
  5. 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

Posting Permissions

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