View Full Version : Administrative and Maintenance Tools - Google Analytics in the Archive (and Forum)
BirdOPrey5
07-08-2010, 10:00 PM
New Version 2.0
New in 2.0: New Improved Google Tracking Code, Code in forum moved to recommended location before the </head> tag.
Uninstall old versions before installing Version 2.0
You will need your Google Analytics tracking ID when installing or upgrading. (UA-XXXXXX-X)
The main purpose of this mod was originally to add your Google Analytics code to the archive. The archive traditionally gets overlooked because the standard instructions of copying your analytics code into the footer doesn't cover the archive.
You simply copy and paste your tracking ID into the mod and enable it in your forums and/or archive.
To confirm it is working go to your archive and view the source on any archive page. At the bottom directly above the VB Copyright info should be your google code.
I have tested this in 3.8.6 and 3.8.7 and it will work in all 3.8.x and probably in 3.7 and earlier as well.
For VB4.x see this version: https://vborg.vbsupport.ru/showthread.php?t=256325
You won't see any indication on the pages but you can demo the product at:
http://www.juot.net/forums/archive/index.php
(You will have to view source to confirm it is working.)
Please mark as installed if you use this. :)
Full instructions in .zip file.
salafmisr.net
07-09-2010, 10:18 PM
hello
you don't need a plugin to do that
just open the index.php file in the archive folder , and place the Google Analytics script at the end of it , and voila ! the code is working like a charm in all the archive pages
BirdOPrey5
07-09-2010, 10:26 PM
cool... I will update the mod but I think it's important to keep so people don't forget to do this.
Manoel J?nior
07-11-2010, 03:29 PM
Prefer this trick.
For when I upgrade my vBulletin, will not have to worry about changing the file on hand.
Thanks! Installed
Fergal C
10-14-2010, 08:33 AM
...just open the index.php file in the archive folder , and place the Google Analytics script at the end of it...
Should that be at the very end of it, i.e. after the last closing PHP tag "?>"
Thanks!
BirdOPrey5
10-14-2010, 12:47 PM
No...
In index.php look for the code:
$output .= "
<div id=\"copyright\">$vbphrase[vbulletin_copyright]</div>
</div>
</body>
</html>";
And paste the google code directly before </body>.
Remember you will need to redo this each time you upgrade vbulletin if you do it this way.
Also you will have to 'escape' every double quote in the google code with a slash \ as explained in the top post.
EDIT- Actually it might work at the very very end of the file, AFTER the php closing tag too... I haven't tested it but that should work and no need to escape the quotes. But it wouldn't be valid HTML because all the code should be before the </html> so it may not work in all browsers.
Jack12
10-14-2010, 01:00 PM
Great work (not that you need to be told :p) mate, will install when I've got a little spare time.
Cheers.
Fergal C
10-15-2010, 09:40 AM
...EDIT- Actually it might work at the very very end of the file, AFTER the php closing tag too... I haven't tested it but that should work and no need to escape the quotes. But it wouldn't be valid HTML because all the code should be before the </html> so it may not work in all browsers.
Thanks BirdOPrey5, I've added it there and it seems to work OK. Perhaps it's not valid HTML, but hopefully won't do any harm in the archive.
SnakeEaterITA
01-01-2011, 07:43 PM
Even if I put the code in my template, it looks like Analytics is unable to get the traffic data from the forum...anyone with the same problem?
BirdOPrey5
01-01-2011, 08:05 PM
I go to Google Analytics -> Content Overview -> Full Report and do a search for "archive" and I see a bunch or archive URLs so i know it's working...
I suppose it's possible if the code wasn't escaped properly you might not got it to work... I will upgrade this from a plugin to a real installable mod so people don't have to escape the code themselves...
Also you made sure to wait 24 hours before checking your analytics?
BirdOPrey5
01-01-2011, 11:08 PM
Update!!
I have upgraded this to an installable product, you simply install like any other product, copy and paste your Google Analytics code.
If you have the old plugin installed delete it first before installing this product. Full instructions in the zip fie.
Bin7raib
01-02-2011, 10:11 AM
Great, installed.
SnakeEaterITA
01-02-2011, 04:56 PM
Updated. I'll wait another 24hrs...let's hope it works this time :)
BirdOPrey5
01-02-2011, 04:57 PM
If you have a link to the forum I can check...
SnakeEaterITA
01-02-2011, 05:55 PM
If you have a link to the forum I can check...
here it is: www.upsblogit.com/newforum :up:
BirdOPrey5
01-02-2011, 07:14 PM
There seems to be an error on your archive page: http://www.upsblogit.com/newforum/archive/index.php
I see the code fine in your regular footer, not sure if it's from the mod or you manually put it in your footer.
Please see if you disable the mod on the archive if it goes away?
BirdOPrey5
01-02-2011, 07:34 PM
FYI - I made a very minor change and released version 1.13... All it changes is the output formating of the code for easier debugging in case of a problem.
SnakeEaterITA
01-02-2011, 08:06 PM
There seems to be an error on your archive page: http://www.upsblogit.com/newforum/archive/index.php
I see the code fine in your regular footer, not sure if it's from the mod or you manually put it in your footer.
Please see if you disable the mod on the archive if it goes away?
Ok, i removed the code from the footer and disabled the plugin, but the error remains. I'm sending you the whole index.php : i don't understand what to do and where to find the error...
Lynne
01-02-2011, 08:14 PM
Ok, i removed the code from the footer and disabled the plugin, but the error remains. I'm sending you the whole index.php : i don't understand what to do and where to find the error...
It isn't an error from his modification - it's an error from another modification. You'll need to find which one and then disable it.
BirdOPrey5
01-02-2011, 08:33 PM
Ok, i removed the code from the footer and disabled the plugin, but the error remains. I'm sending you the whole index.php : i don't understand what to do and where to find the error...
If my mod is disabled and you still get the error it's likely another mod is causing the issue. Your index.php file is perfectly fine (which you sent to me by PM) so it's definitely another mod. If you are interested in trouble shooting try disabling all your other mods and re-enabling them one by one, each time checking to see if/when the error returns.
SnakeEaterITA
01-02-2011, 08:41 PM
Ok, I disabled each plugin, one by one, but the error is still there >:(
damn...I remember that, following some guides, I added the Analytics script in the footer and in another page, but I'm unable to remember WHERE...
BirdOPrey5
01-02-2011, 08:47 PM
I suggest you try disabling hooks to confirm where the problem is. There are no templates in the archive.
To disable hooks edit your config.php... add this as the second line, directly below the opening tag <?php
define('DISABLE_HOOKS', true);
Then check again if you still have the archive error.
SnakeEaterITA
01-02-2011, 08:51 PM
Ok, no more error removing the hooks. Consider I don't even know what is a hook :'(
Now what to do? What changes if i remove hooks?
BirdOPrey5
01-02-2011, 08:57 PM
Disabling hooks *really* disables every single mod and plugin... You should re-enable them again but now we know for sure the problem is with a plugin, not altered vbulletin files.
Re-enable your hooks, confirm the error is back...
Then go to Admin CP -> Plugin Manager and tell me what plugins you have at the top under Product: vBulletin (if any)...
SnakeEaterITA
01-02-2011, 09:03 PM
Sh*t, found it!
It was my fault as I looked at Products instead of Plugins... it was this one:
Name: Code in Archive
Hook Location: archive_complete
PHP Code:
$output .= "<script src=\"http://www.google-analytics.com/urchin.js\" type=\"text/javascript\">
</script>
<script type=\"text/javascript\">
_uacct = \"XXXXXXXXXXXXXXXXXXXXXXXXXXX\";
urchinTracker();
</script>";
<!--Paste Google Adsense Code (with slashes) Above This Line-->
';
BirdOPrey5
01-02-2011, 09:22 PM
yeah,, good, delete that plugin, you won't need it anyway with this mod.
www.ch-joy.com
01-03-2011, 10:27 AM
tankx :-)
Edgespeeder06
01-03-2011, 11:52 PM
installed but google tells me that no tracking is installed?
www.NJStangers.org I don't see it on my pages neither even though its in the google anayltics product I added to the backend
BirdOPrey5
01-04-2011, 12:05 AM
It's definitely in your archive... I see it's not on your pages though... I think it's because you have the "Branding" removed from vBulletin (branding free license)- I wasn't taking that into consideration when I tied the Analytics code to the copyright... If there's no copyright there's no analytics code.
I suggest you manually add the code to your footer template but leave the mod installed for the archive.
I'll work on fixing this.
Edgespeeder06
01-04-2011, 12:09 AM
ah okay that happened when we did the custom garage as well as a few other mods, that explains it. Thanks again.
BirdOPrey5
01-04-2011, 12:43 AM
ah okay that happened when we did the custom garage as well as a few other mods, that explains it. Thanks again.
I just uploaded a new version that puts the code in the footer instead of the copyright text- version 1.2 will now work in both places.
BirdOPrey5
05-24-2011, 09:25 PM
Uploaded version 2.0.
Now uses newer, better Google Javascript code.
Tracking code now in the Google recommended location (before </head>)
You now enter only your Tracker ID into the mod settings, not the whole code.
I suggest everyone upgrade to new version at their convenience,
Gadget_Guy
05-24-2011, 10:33 PM
Update installed.
Thanks for keeping the mod current!
D.
Rafael?
07-18-2011, 09:02 PM
good! thanks!
smp3000
01-22-2012, 02:18 AM
Does anyone know how to get the new version of google analytics to show "Guests" or those not logged in using their realtime overview?
Alfa1
01-07-2015, 02:04 PM
This needs an update with adjusted bounce rate: http://www.hmtweb.com/marketing-blog/adjusted-bounce-rate-in-google-analytics/
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.