vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - Google Analytics in the Archive (and Forum) by BOP5 (https://vborg.vbsupport.ru/showthread.php?t=256325)

BirdOPrey5 01-21-2011 08:54 PM

Thanks for confirming... I would check your plugins for any mods on the "member_location" hook first.

bosken 01-22-2011 03:22 AM

Installed on v.4.1.1 Works

HughM 01-22-2011 05:36 PM

Nice mod. I'd put the code into the template manually, but it's nice to have it nicely configurable...

HughM 01-26-2011 10:31 PM

I'm going to have to take back my "Nice mod" comment...

You have a nasty bug in your code, and I've now got no idea where, on our website's launch day, people came from, or what they did. This was important to me.

Your mod allows admins to have the code inserted into both the archives and the main forum. The archives bit works fine, but on the main , when it inserts the code, it has escaped each and every quote...

My main forum footer had something like the following in:

Code:

<script type=\"text/javascript\">

  var _gaq = _gaq || [];
  _gaq.push([\'_setAccount\', \'UA-########-#\']);
  _gaq.push([\'_trackPageview\']);

  (function() {
    var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;
    ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';
    var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

Which was never going to work...

Obviously, we didn't pay for it, and there's no guarantee that it'll work, but it's still incredibly annoying, and I'm sure others will be very appreciative of a fix to this one...

BirdOPrey5 01-26-2011 11:41 PM

Wow very sorry about this. I do see the bug and have fixed it and released a new version. I did use the check in google analytics to confirm the code was on the page, I don't understand how it confirmed it with the bad code.

Anyway here is a copy and paste of the code from my actual page with this code from version 1.5:

HTML Code:

<!--Google Analytics in (Forum) Begin-->
<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-5383701-1");
pageTracker._setSessionTimeout("3600");
pageTracker._trackPageview();
</script>
<!--Google Analytics in (Forum) End-->

As to why this bug was there, it seems in the VB 3.x version the add-slashes is necessary (as they are removed before being output) but not so in VB 4.x.

OldSchoolDSL 01-26-2011 11:49 PM

Upgraded to 1.5 (allow overwrite, yes)

Installed

4.1.1

To the best of my knowledge, its working.

HughM 01-27-2011 06:41 AM

Thanks for the speedy update... Will install and give it a go...

Someone else pointed out that we've still got awstats running on the server, so we've got some idea of what went on and where people came from...

Anyone know if you can give google analytics a chunk of access.log and get it to update itself? That'd be very cool to be able to do...

OldSchoolDSL 03-05-2011 03:03 AM

This was a wonderful modification and well thought out. It works flawlessly in 4.1.2.

vBSEO has this build in it (Google Analytics) though and I'm converting to Mint, which runs locally and does not depend on an outside link (in this case, Google).

Un-installed.

BirdOPrey5 03-05-2011 11:55 AM

I looked at Mint but it's requirement for javascript to be on to count a hit kind of defeats the purpose of self hosted analytics IMO. The biggest issue with Google isn't load times but that if someone is browsing with noscript enabled (like I'd imagine your users might be prone to do) Google will never count them. Mint won't either though.

OldSchoolDSL 03-05-2011 01:01 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2169797)
I looked at Mint but it's requirement for javascript to be on to count a hit kind of defeats the purpose of self hosted analytics IMO. The biggest issue with Google isn't load times but that if someone is browsing with noscript enabled (like I'd imagine your users might be prone to do) Google will never count them. Mint won't either though.

This is true... Users running noscript (http://noscript.net) are not always be counted. Know of any alternatives for local tracking?

This was a very useful modification though and you should be very proud of the work you help provider here for this community.


All times are GMT. The time now is 06:33 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.01096 seconds
  • Memory Usage 1,742KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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