Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Google Analytics in the Archive (and Forum) by BOP5 Details »»
Google Analytics in the Archive (and Forum) by BOP5
Version: 1.6, by BirdOPrey5 (Senior Member) BirdOPrey5 is offline
Developer Last Online: Aug 2023 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 4.x.x Rating:
Released: 01-01-2011 Last Update: 05-29-2012 Installs: 133
Supported Uses Plugins Auto-Templates
Re-useable Code Translations  

Brought to you by BirdOPrey5
www.Qapla.com


Upgraded to version 1.6 - Updated option to put code in header OR footer on forum pages.
  • Header - Recommended location by Google for the Asyncronous Code (the popular code)
  • Footer - Recommended location for non-Async (legacy) tracking code.

I strongly urge everyone to confirm with google your code is working by checking the analytics the next day after installing to confirm your hits are bing registered. The google tool for confirming the code is on the page is not good enough!

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 the full analytics code Google gives you into the mod options and enable it.

Optionally you can also use this mod to put your analytics code in the regular forum (non-archive) as well, however if you have already manually put your analytics code in the footer you should leave this option disabled.

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 on 4.0.8, 4.1.12, and 4.2.0 and it will work in all 4.0.x and 4.1.x /4.2.x at least.

For a VB 3.8 version see here: https://vborg.vbsupport.ru/showthread.php?t=246171

You won't see any indication on the pages but you can demo the product at:
www.qapla.com/mods/

Please mark as installed if you use this.
Donations Always Appreciated. :up:

English - Download .zip file. Version 1.6
Arabic - Translated by Dr. OsamA - Download .xml file. Version 1.13 (old version)

Download Now

File Type: xml product-googinarchivebop5vb4-Arabic by alra7ba.xml (4.7 KB, 154 views)
File Type: zip Google Analytics in Archive by BOP5 - VB4 v16.zip (3.1 KB, 300 views)

Screenshots

File Type: jpg ss_archive_settings.jpg (88.0 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
4 благодарности(ей) от:
dorans, mapleleaffans, markoroots, misericorde

Comments
  #32  
Old 01-21-2011, 08:54 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for confirming... I would check your plugins for any mods on the "member_location" hook first.
Reply With Quote
  #33  
Old 01-22-2011, 03:22 AM
bosken bosken is offline
 
Join Date: Jan 2011
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed on v.4.1.1 Works
Reply With Quote
  #34  
Old 01-22-2011, 05:36 PM
HughM HughM is offline
 
Join Date: Jan 2011
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice mod. I'd put the code into the template manually, but it's nice to have it nicely configurable...
Reply With Quote
  #35  
Old 01-26-2011, 10:31 PM
HughM HughM is offline
 
Join Date: Jan 2011
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #36  
Old 01-26-2011, 11:41 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #37  
Old 01-26-2011, 11:49 PM
OldSchoolDSL OldSchoolDSL is offline
 
Join Date: Oct 2010
Posts: 1,196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Upgraded to 1.5 (allow overwrite, yes)

Installed

4.1.1

To the best of my knowledge, its working.
Reply With Quote
  #38  
Old 01-27-2011, 06:41 AM
HughM HughM is offline
 
Join Date: Jan 2011
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #39  
Old 03-05-2011, 03:03 AM
OldSchoolDSL OldSchoolDSL is offline
 
Join Date: Oct 2010
Posts: 1,196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #40  
Old 03-05-2011, 11:55 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #41  
Old 03-05-2011, 01:01 PM
OldSchoolDSL OldSchoolDSL is offline
 
Join Date: Oct 2010
Posts: 1,196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:38 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04830 seconds
  • Memory Usage 2,338KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (4)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete