Using Woopra with vBulletin

March 22, 2010 | By

I’ve been using Woopra, the real-time Web tracking and analysis application, with CodeHill for over year now. The WordPress plugin they provide is working perfectly. But I recently added DoFollowForum.com, which is running vBulletin, and the available plugin was for an older version of vBulletin than the one I have installed. So I added the following tracking code to the style’s footer to track users with their usernames and emails.

The if statement is to make sure I dont track the user with the user id 1. Line 4 and 5 use vBulletin’s array $bbuserinfo to get the username and email. When using vBulletin’s variables inclose them in a tag so vBulletin would identify them.

Filed in: Web Development | Tags: ,

Comments (14)

  1. Thanks for the code. I’ll add it to our Installation Guide tips!

  2. Thank you Lorelle for the link in Woopra’s Installation Guide. Its an honor.

  3. Peony

    Hey, How can I use this with a subdomain? this is the subdomain code:

    woopraTracker.setDomain(“mysitenamehere.com”);
    woopraTracker.track();

  4. Peony

    sorry code got cut off..

  5. Hey Peony, just call setDomain() before calling track(), and setDomain()’s argument is the root domain not the sub-domain. e.g.:

     <if condition="$bbuserinfo[userid]!=1">  
       <script type="text/javascript" src="//static.woopra.com/js/woopra.v2.js"></script>  
       <script type="text/javascript">  
         woopraTracker.addVisitorProperty("name", 
             "<phrase>$bbuserinfo[username]</phrase>");  
         woopraTracker.addVisitorProperty("email", 
             "<phrase>$bbuserinfo[email]</phrase>");  
         woopraTracker.setDomain("codehill.com");
         woopraTracker.track();  
       </script>  
     </if>  
    

    And by the why, the Basic (free) account doesn’t log sub-domains.

  6. peony

    hey I just upgraded and did what you posted added it to footer did you mean I should change the domain to be domain.com/forum? where it says codehill

    The following error occurred when attempting to evaluate this template:

    The conditional on line 143 appears to be missing its beginning tag (). This may cause unexpected behavior.

    This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

  7. peony

    hey i am not sure that its working now i didnt get an error, i copied from plain texyt but i dont see if its tracking or not or anything about users linked to visitors? thanks!!!!

  8. Hey peony, if you want to use it with a folder in the domain for example domain.com/forum all you need it the code in the post. But if you want to use it with a sub-domain for example forum.domain.com then use the code I added in the comments. This should resolve the error.

    When it starts working you’ll see the visitor’s login instead of Visitor in the Live tab above the flag and to left of the Start Chat button. And if you don’t have a visitor currently logged into your forum you could go to the Analytics tab and then click on Custom where you’ll find the login names under Tagged Visitors.

  9. peony

    Hey Amgad,
    Ok well Its on a .com/forum so I have the code you put just .com put this in the footer of the template, at first it showed my username logged into the forum now its not showing me or anyone makes me think i am doing something wrong!! 🙁

  10. Could you please post the code you put in your footer and let me check it out.

  11. peony

    I think its only showing the wordpress visits bc I just signed into WP and then it showed my Uname but i dont know

    this is the code
    1.
    2.
    3.
    4. woopraTracker.addVisitorProperty(“name”,
    5. “$bbuserinfo[username]”);
    6. woopraTracker.addVisitorProperty(“email”,
    7. “$bbuserinfo[email]”);
    8. woopraTracker.setDomain(“codehill.com”);
    9. woopraTracker.track();
    10.
    11.

    I put the domain name of my root domain, the wordpres sinstall is on the .com and the forum is .com/forum
    but I just said .com like codehill.com is. Let me know, you can email e too if you want.. Thanks!

  12. Peony the code you posted will not work, it’s missing a few lines and you shouldn’t use the setDomain function because you aren’t running the forum from a sub-domain. Just copy the following code and paste it instead of your code, it will work with your forum without any changes:

      
          
          
    
    

    To copy the code please use the View Plain link right above it.

  13. peony

    Hey thanks but I dont think that code works 🙁 doesnt show the users fro the forum at all!

  14. peony

    OOH i think it might work now