vBulletin 4, the most powerful community software + vBSEO 3.5, the ultimate SEO solution = Your ultimate platform for 2010 and beyond. Click below to learn more.

Results 1 to 11 of 11

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

    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
    seoville
    Posts
    3,871
    What exactly are you looking to do?
    Brian Cummiskey / Crawlability Inc.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Final)- Released for your Evaluation


    Check us out on FaceBook!

  3. #3
    Junior Member
    Real Name
    Valentin
    Join Date
    Jan 2009
    Posts
    4
    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
    seoville
    Posts
    3,871
    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.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Final)- Released for your Evaluation


    Check us out on FaceBook!

  5. #5
    Junior Member
    Real Name
    Jon Schvili
    Join Date
    Jan 2008
    Posts
    6
    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
    vBSEO Staff Ceri May's Avatar
    Real Name
    Ceri May
    Join Date
    Jul 2009
    Location
    United Kingdom
    Posts
    937
    Hi Jon,

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

    vbseo/includes/functions_vbseo.php

    Ceri
    Ceri May / Crawlability Inc.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Final)- Released for your Evaluation


    Check us out on FaceBook!

  7. #7
    Junior Member
    Real Name
    Jon Schvili
    Join Date
    Jan 2008
    Posts
    6
    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
    seoville
    Posts
    3,871
    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.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Final)- Released for your Evaluation


    Check us out on FaceBook!

  9. #9
    Junior Member
    Real Name
    Jon Schvili
    Join Date
    Jan 2008
    Posts
    6
    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
    seoville
    Posts
    3,871
    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.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Final)- Released for your Evaluation


    Check us out on FaceBook!

  11. #11
    Junior Member afloresm's Avatar
    Real Name
    Alejandro Flores
    Join Date
    May 2008
    Posts
    3
    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.

Similar Threads

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