vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=246171

Google Analytics in the Archive (and Forum)
by BirdOPrey5
09 Jul 2010 01:18

1 Attachment(s)
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: http://www.vbulletin.org/forum/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 09 Jul 2010 23:18

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 09 Jul 2010 23:26

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 11 Jul 2010 16:29

Prefer this trick.

For when I upgrade my vBulletin, will not have to worry about changing the file on hand.

Thanks! Installed

Fergal C 14 Oct 2010 09:33

Quote:

Originally Posted by salafmisr.net (Post 2067013)
...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 14 Oct 2010 13:47

No...

In index.php look for the code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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 14 Oct 2010 14:00

Great work (not that you need to be told :p) mate, will install when I've got a little spare time.

Cheers.

Fergal C 15 Oct 2010 10:40

Quote:

Originally Posted by BirdOPrey5 (Post 2110076)
...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 Jan 2011 20:43

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 Jan 2011 21:05

1 Attachment(s)
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 02 Jan 2011 00:08

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 02 Jan 2011 11:11

Great, installed.

SnakeEaterITA 02 Jan 2011 17:56

Updated. I'll wait another 24hrs...let's hope it works this time :)

BirdOPrey5 02 Jan 2011 17:57

If you have a link to the forum I can check...

SnakeEaterITA 02 Jan 2011 18:55

Quote:

Originally Posted by BirdOPrey5 (Post 2142818)
If you have a link to the forum I can check...

here it is: www.upsblogit.com/newforum :up:


All times are GMT. The time now is 23:48.

Powered by vBulletin® Version 3.8.12
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.