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

Reply
 
Thread Tools
Dynamic Google Analytics Details »»
Dynamic Google Analytics
Version: 1.0.1, by bdude bdude is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.7.x Rating:
Released: 01-22-2008 Last Update: 01-24-2008 Installs: 153
Uses Plugins Auto-Templates
Re-useable Code Translations  
No support by the author.

Dynamic Google Analytics

This is a very simple mod, it adds the ability to dynamically generate the code for Google Analytics.

Quote:
Originally Posted by Logician View Post
For visitors who didn't understand what the hack does:

It creates a google analytics section in your vb options page and when you enter analytics ID there, it automatically puts analytics code into your footer.

If you don't install this hack, you can do the same by copy/pasting google analytics code in your footer template.
Version History:
1.0 - Initial Release, using ga.js instead of urchin.js
1.0.1 - Removed vB 3.7 requirement

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 01-25-2008, 07:01 AM
Collussus Collussus is offline
 
Join Date: Oct 2007
Posts: 71
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bdude View Post
My most humble apologies for not fully testing this (I'm new to vB Development), you should see a new setting group called 'Google Analytics'
Now it works -clicks install-

EDIT:

Do you fill in the number with or without "UA-"?
Reply With Quote
  #23  
Old 01-25-2008, 08:56 PM
bdude's Avatar
bdude bdude is offline
 
Join Date: Dec 2005
Location: Australia
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Do you fill in the number with or without "UA-"?
With UA-
Reply With Quote
  #24  
Old 01-26-2008, 02:03 AM
Martell Martell is offline
 
Join Date: Dec 2006
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, useful product for analytics on Google.
Reply With Quote
  #25  
Old 01-26-2008, 03:58 PM
Collussus Collussus is offline
 
Join Date: Oct 2007
Posts: 71
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bdude View Post
With UA-
Doesn't seem to send the information to analytics for me... I'm pretty sure i get around 100 unique hits daily but it only shows 3, seems unlikely to me.
Reply With Quote
  #26  
Old 02-02-2008, 12:29 AM
rinkrat's Avatar
rinkrat rinkrat is offline
 
Join Date: Jan 2002
Location: Long Beach
Posts: 530
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I turned it on so I guess I wait a few days and check the stats at Google.
Reply With Quote
  #27  
Old 02-07-2008, 09:11 AM
DrKNickel DrKNickel is offline
 
Join Date: Oct 2007
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks nice but does it work?
Reply With Quote
  #28  
Old 02-18-2008, 10:20 PM
nitro nitro is offline
 
Join Date: Nov 2001
Posts: 302
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would this not be better in the global_complete hook location with something like:

PHP Code:
if ($vbulletin->options['ga_enable']) {

        
$vbulletin->config['google_analytics']['replacementvariable'] = '</body>';
        
$output str_replace($vbulletin->config['google_analytics']['replacementvariable'],
        
$code.$vbulletin->config['google_analytics']['replacementvariable'], $output);


This way you are anchoring onto the closing body tag as google instructs and the global_complete location is a better place to do this, not just for vbulletin itself but other addons which may use alternative templates for headers. footers etc.

The google code could perhaps be an additional temple for eval in which case it would want a cache plugin. A textarea option to add scipts to exclude the code from maybe quite a desireable feature to add. Was just a few thoughts, nice hack still.
Reply With Quote
  #29  
Old 02-19-2008, 02:18 AM
bdude's Avatar
bdude bdude is offline
 
Join Date: Dec 2005
Location: Australia
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@nitro: Thanks for the suggestions, I am quite new to vB coding - and if I have any spare time, I will try and implement your suggestions.
Reply With Quote
  #30  
Old 02-26-2008, 03:49 PM
AndrewC1971 AndrewC1971 is offline
 
Join Date: Dec 2007
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

do u have to put in the google analytics html

or just you Google Analytics UA number?
Reply With Quote
  #31  
Old 03-19-2008, 03:27 AM
tmiland tmiland is offline
 
Join Date: Mar 2008
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sweet!
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 07:31 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.04672 seconds
  • Memory Usage 2,308KB
  • Queries Executed 25 (?)
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_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete