vBulletin makes good forum software, but it’s hard to add Google Analytics to it. Most of the instructions that you find online on how to add the Google Analytics code don’t work for the forum archives.
UPDATE: I recommend just installing vbSEO instead of the solution below because you can add Google Analytics directly through the vbSEO interface. vbSEO also adds many other critical SEO improvements to the basic vBulletin installation. However, the solution below can still be used to add other types of tracking code to vBulletin, like Clicky Stats, and excellent free Web 2.0 stats program.
Here are some step-by-step instructions for adding Google Analytics (or other tracking code, like Clicky) to vBulletin:
In your vBulletin admin control panel, click on Style Manager and navigate your way through the options to “edit templates”. Double click on the footer template. Add your Google Analytics or other tracking code right at the bottom of the footer template. That will enable tracking for the main part of your forum.
To get the tracking code into the archives, click on “Add New Plugin”, and from the select box choose archive_complete. Enter the following code in the textarea and make the plugin active:
$output .= "<script src=\"http://www.google-analytics.com/urchin.js\" type=\"text/javascript\"> </script> <script type=\"text/javascript\"> _uacct = \"UA-XXXXXXX-X\"; urchinTracker(); </script>";
If you are using another analytics system, just replace the Google Analytics code with it, being sure to escape all double quotes with a backslash.
vBSEO
Also, if you are using vBulletin, I highly recommend using vBSEO to optimize your forums. vBSEO will create clean, search engine friendly URLs on your forum and 301 redirect the old URLs to the new URLs. It will also provide other SEO benefits like remove the redirects in RSS feeds, remove the links to /index.php, and add trackback and pinging features. vBSEO can also add Google Analytics code to your forum…
Popularity: 19% [?]

9 Comments
Hi there!
thank you so much for this information I have a vbulletin forum, and for I long time I did not find the way to put the analytic code into the vb, but now it’s perfect, thank you so much
Thanks for this, where would you add statcounter code in vbulletin?
Same place as for Google Analytics. Just be sure to escape any double quotes with backslashes when adding the Statcounter code to the vBulletin archives.
Thanks a lot.. information very helpful!ü
Thanks – where would you find the “Add New Plugin” area in vBulletin? I would love to be able to place GA in the archives…if I knew where the “Add new plugin” was!
Thanks in advance!
Perfect! I have been always curious on how many visitors are coming to my site but never knew how to install GA with VB. Very helpful info!
Thanks for the heads up
VB plugin works 100%
What about the new google analytics code?
I can’t figure out the strikeouts, lol.
@Matt
You have to put a backslash before every double quote in the Analytics code — that is the only modification.