Results 1 to 6 of 6

Google Analytics: Tracking of Usernames

This is a discussion on Google Analytics: Tracking of Usernames within the General Discussion forums, part of the vBulletin SEO Discussion category; Hello everybody! I'm using the Analytics feature of vBSEO now. In the past I tracked the Usernames of my members ...

  1. #1
    DBB
    DBB is offline
    Junior Member Array
    Real Name
    Daniel
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    3
    Liked
    0 times

    Google Analytics: Tracking of Usernames

    Hello everybody!

    I'm using the Analytics feature of vBSEO now. In the past I tracked the Usernames of my members with this little piece of code:
    Code:
    <script language="text/javascript">__utmSetVar('$bbuserinfo[username]');</script>
    Unfortunatley I can't do this now, because the javascript has to be placed after the Tracking-Code and this seems to be impossible with vBSEO. vBSEO adds the Tracking-Code automatically at the end right before the </body>.

    I like this special feature of Analytics, because I can filter out klicks of my team and so on.
    Is there any possibility to add this code after the Trackng-Code in order to get this working?

    Thanks in advance..

  2. #2
    vBSEO Staff Array Juan Muriente's Avatar
    Real Name
    Juan Carlos Muriente
    Join Date
    Jun 2005
    Location
    Puerto Rico
    Posts
    14,277
    Liked
    612 times
    You can either disable the analytics option via your vbseocp and enter the code manually in your templates or you can modify the "vBSEO Global Hook" in admincp with something like:
    PHP Code:
     if(@include_once(($GLOBALS['vbpath']?$GLOBALS['vbpath'].'/includes':dirname(__FILE__)).'/functions_vbseo.php'))
    {
        
    $output make_crawlable($output);
    $output str_replace('</body>'"
    <script language="
    text/javascript">__utmSetVar(\''.$bbuserinfo['username'].'\');</script>
    </body>', 
    $output);

    Juan Muriente / Crawlability Inc.
    Security bulletin - Patch Level for all supported versions released

    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  3. #3
    DBB
    DBB is offline
    Junior Member Array
    Real Name
    Daniel
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    3
    Liked
    0 times
    Thanks for the fast reply

    My vBSEO Global Hook looks like this now:
    PHP Code:
    if(@include_once(($GLOBALS['vbpath']?$GLOBALS['vbpath'].'/includes':dirname(__FILE__)).'/functions_vbseo.php'))
    {
        
    $output make_crawlable($output);
    $output str_replace('</body>''
    <script language="text/javascript">__utmSetVar(\''
    .$bbuserinfo['username'].'\');</script>
    </body>'
    $output);

    This is the result:
    HTML Code:
    <script language="text/javascript">__utmSetVar('');</script>
    </body>
    - The $bbuserinfo['username'] seems not to work... :(

  4. #4
    vBSEO Staff Array Juan Muriente's Avatar
    Real Name
    Juan Carlos Muriente
    Join Date
    Jun 2005
    Location
    Puerto Rico
    Posts
    14,277
    Liked
    612 times
    Please try replacing $bbuserinfo with $vbulletin->userinfo
    Juan Muriente / Crawlability Inc.
    Security bulletin - Patch Level for all supported versions released

    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  5. #5
    DBB
    DBB is offline
    Junior Member Array
    Real Name
    Daniel
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    3
    Liked
    0 times
    aaah very nice - now it works this way:

    PHP Code:
    if(@include_once(($GLOBALS['vbpath']?$GLOBALS['vbpath'].'/includes':dirname(__FILE__)).'/functions_vbseo.php')) 

        
    $output make_crawlable($output); 
    $output str_replace('</body>'
    <script language="text/javascript">__utmSetVar(\''
    .$vbulletin->userinfo[username].'\');</script> 
    </body>'
    $output); 

    thank you

  6. #6
    Member Array
    Real Name
    dingo
    Join Date
    Nov 2008
    Posts
    72
    Liked
    0 times
    I added:

    Code:
    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-12345-1");
    pageTracker._trackPageview();
    __SetVar('$bbuserinfo[username]');
    __SetVar('$GLOBALS[forumid]');
    __SetVar('$bbuserinfo[usergroupid]');
    __SetVar('$thread[title]');
    </script>

    - below the Analytics tracking code.

    I would very much like toknow if there anything else that has to be done for data to show up in Analytics, and also where exactly in Analytics I see the data?
    Last edited by dingo; 08-17-2009 at 11:40 PM.

Similar Threads

  1. Custom 'outgoing links' for google analytics external links tracking
    By Nick0r in forum Sitemap Features Archive
    Replies: 3
    Last Post: 06-16-2006, 07:52 AM
  2. vBSEO 2.4.0 Released - Includes Google AdSense Targeting Feature!
    By Juan Muriente in forum vBSEO Announcements
    Replies: 74
    Last Post: 05-20-2006, 09:29 PM
  3. Google is All About Search: 4 New Products
    By Joe Ward in forum General Discussion
    Replies: 0
    Last Post: 05-16-2006, 01:52 PM
  4. Google Analytics - New Free Tool!
    By skizzy203 in forum Analysis: Traffic & SERPS
    Replies: 29
    Last Post: 11-22-2005, 06:06 AM

Posting Permissions

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