![]() |
google analytics + archive questions
hi,
Where should i place the google analytics code as follows in: Code:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> 2. vB Easy Archive - Search Engine Spiderable Hack from Xenon thanks. |
In the default vbulletin archive, add a new plugin using the archive header start and add in this:
HTML Code:
?> |
did you meant to add a new plugin to this page:
admincp/plugin.php?do=add ?? what should i select under hook location, sorry for being lame i have not read complete information about vb yet :( thanks for helping. |
yep thats the place. The hook location should be called something like archive header start or something close to it. Im at work and wont be home for a few hours but let me know if you cant find it or have problems :)
|
Quote:
|
Could someone explain this a little more step-by-step? I'm trying to figure out how to do this. Surprised more people aren't wondering the same thing.
|
Plugins & Products > Add New Plugin > Hook Location: archive_header_start > Paste code as above.
|
Does the code put into the footer template not work for the archive?
Bob |
It probably does, but I don't know why Reeve of shinra instructed to do it using plugins. I was assuming it wouldn't work the other way.
|
I just looked at the page source in the Archive and the Google script was not there, so this suggests putting it in the footer template does not cover the archives.
I have not tried using it as a plugin yet and removing the code from the footer. Can anyone clear this up please? Bob |
Ah, sorry about that, I though the Archive had it's own templates. No, it wouldn't work in the footer template as the archive generates its own HTML on-the-fly.
|
Yeah, I pulled the archive source after adding Google ads to the archive, and didn't see the tracker in there. So I tried editing the archive/index.php to include the script and it didn't work - wouldn't parse at all, I don't know what I'm doing in there exactly, just pasted it right before the </body>.
So does this plugin thing work for this purpose then? I'll try it. Thanks. I must be blind, I don't see archive_header_start. I see: archive_global archive_process_start archive_postheader archive_navigation archive_forum archive_forum_thread archive_thread_post archive_complete |
Use archive_process_start :).
|
Thanks, I used archive_complete and it worked, so I think I'll leave it. Cheers.
|
I used archive_complete and get the following error:
Quote:
|
What are you putting in for the PHP code.
|
Quote:
Fixed it. You have to put PHP Code:
|
I'm bumping this thread as I really want to have my archive tracked by Google Analytics, however the new code is different from the one you posted above. My new code looks like this:
PHP Code:
Anybody? thanks in advance :) |
PHP Code:
|
Quote:
Thanks again, dismounted! |
Thanks for this thread - I just did this on our forum. The Google code has changed a little bit:
PHP Code:
--Add this first: Code:
$output .= ' --Add this at the end: Code:
'; |
All times are GMT. The time now is 03:39 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|