How to add Google Analytics tracking code to vBulletin 4


29.01.2010

vBulletin (vB) is commercial Internet forum software produced by Jelsoft Enterprises and vBulletin Solutions. It is written in PHP and uses a MySQL database server. vBulletin 4 was released December 21, 2009. New for vBulletin 4 is the vBulletin production suite, which includes blog functions.

From that perspective, users may need to add Google Analytics tracking code in vBulletin 4. The problem is that not all of us know the way around PHP codes, so they make mistakes and end up with errors like:

“Parse error: syntax error, unexpected ‘[‘
in /home/forums/includes/adminfunctions_template.php(4595) : eval()’d code on line 18"

These kinds of errors must be corrected before you continue, otherwise the Google Analytics tracking codes will not function.

Google Analytics Tracking code in vBulletin 4

The majority of the errors encountered by one user are related to special characters that Google Analytics tracking code has and they are not understood correctly by the vBulletin 4.

A solution to this matter is embedding the tracking code using the <vb:literal> and </vb:literal> tags . You must add these tags to the beginning of the code and at the end of the code.

  • Example: <vb:literal> Google Analytics tracking code here </vb:literal>

As for the place you can insert the Google Analytics tracking code we recommend at the end of the ad template in order to avoid other errors.

Tags: code, vbulletin, tracking, analytics, google, vbliteral, errors, they, codes, tags, must, these, error, function, user, otherwise, majority, encountered, eval’d, kinds, related, corrected, line, continue, correctly, insert, place, example, recommend, template