vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   google analytics + archive questions (https://vborg.vbsupport.ru/showthread.php?t=107967)

Dismounted 05-20-2007 08:53 AM

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.

styleforum 05-20-2007 04:08 PM

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

Dismounted 05-21-2007 05:25 AM

Use archive_process_start :).

styleforum 05-21-2007 05:52 AM

Thanks, I used archive_complete and it worked, so I think I'll leave it. Cheers.

Spinball 07-03-2007 12:11 PM

I used archive_complete and get the following error:
Quote:

Parse error: syntax error, unexpected '<' in /home/sites/avforums/public_html/forums/archive/index.php(453) : eval()'d code on line 1
when I view archive pages using 3.6.7PL1

Dismounted 07-04-2007 04:18 AM

What are you putting in for the PHP code.

Spinball 07-04-2007 06:19 AM

Quote:

Originally Posted by Dismounted (Post 1282446)
What are you putting in for the PHP code.

Erm, just putting the Google HTML Script tags. No PHP code.

Fixed it.
You have to put
PHP Code:

$output .= "<script src=\"http://www.google-analytics.com/urchin.js\" type=\"text/javascript\">
</script>
<script type=\"text/javascript\">
_uacct = \"XX-XXXXXXX-X\";
urchinTracker();
</script>"


in to the archive_complete hook.

Voyager-S 04-20-2008 07:45 AM

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:

<script type="text/javascript">
var 
gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." "http://www.");
document.write(unescape("%3Cscript src='" gaJsHost "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</
script>
<
script type="text/javascript">
var 
pageTracker _gat._getTracker("UA-XXXXXXX-1");
pageTracker._initData();
pageTracker._trackPageview();
</
script

What should I do to have this added to my archive? I tried using a plugin from archive_complete but I get a parse error everytime, and other different errors.

Anybody? thanks in advance :)

Dismounted 04-20-2008 07:59 AM

PHP Code:

$output .= '<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-XXXXXXX-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>'



Voyager-S 04-20-2008 08:12 AM

Quote:

Originally Posted by Dismounted (Post 1495021)
PHP Code:

$output .= '<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-XXXXXXX-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>'



Oh wow, thank you!! It finnally works. Now I only have to wait and see if the results get tracked in Google Analytics :)

Thanks again, dismounted!


All times are GMT. The time now is 07:54 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02345 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete