vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Administrative and Maintenance Tools - BBR Google Analytics Addon (https://vborg.vbsupport.ru/showthread.php?t=229347)

TeknoSounds 01-20-2011 02:46 AM

It works fine on mine...according to the page source it shows up just before the end of the header section.

Did you go into the options of the plugin and change them to the header and not the footer?

polle 01-20-2011 07:45 AM

Yes, I have "Add code just above the opening body tag" selected as yes, but the code is after the closing </head> and not before.

Any idea ?

TeknoSounds 01-20-2011 10:40 AM

Hmm I moved mine up and I'm now getting an error on all my pages according to firebug:

Code:

script is not defined  Line 24

Line 24 : var s = document.getElementsByTagName(script)[0]; s.parentNode.insertBefore(ga, s);


TeknoSounds 01-20-2011 10:46 AM

Okay, fixed the error...
In Plugin Manager -> BBR Google Analytics -> Edit

Find:
Code:

var s = document.getElementsByTagName(script)[0]; s.parentNode.insertBefore(ga, s);
Replace with:
Code:

var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);
note the \' around script

TeknoSounds 01-20-2011 10:48 AM

Quote:

Originally Posted by polle (Post 2151850)
Yes, I have "Add code just above the opening body tag" selected as yes, but the code is after the closing </head> and not before.

Any idea ?

Link to your site?

Also visit mine, do a page source, see if you're seeing it like on mine.

btw, did you upgrade it from a previous version? or a fresh install?

polle 01-20-2011 11:11 AM

Actually you don't have any google analytics in your forum.

See it here, is a fresh install of forum and plugin.

Thanks.

TeknoSounds 01-21-2011 06:16 AM

Quote:

Originally Posted by polle (Post 2151898)
Actually you don't have any google analytics in your forum.

See it here, is a fresh install of forum and plugin.

Thanks.

Oh man! thanks for pointing that out! I fubar'd the escape characters and screwed it up :p
Check again and it should now be showing.
Hmm you're using a different version or something compared to mine...the code that renders on yours is different.
Even though I have 1.0.3 my code in mine is different. I'm going to verify the script on googles site for async.

The good news is I also found where the error is :) Checking real fast to make sure thats the right code, then will post up the fix.

TeknoSounds 01-21-2011 06:24 AM

Okay to fix the <body> issue:
AdminCP -> Plugin Manager -> Edit BBR Google Analytics
Find
Code:

$BBR_find='<body>';
and change it to
Code:

$BBR_find='</head>';
What I'm worried about is the change between the latest file on here and my version...the function difference is this:
Mine & on Google's site
Code:

(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);
})();

versus whats in the latest file on here:
Code:

  (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';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
  })();

Note the last line there....

polle 01-22-2011 07:58 AM

Changing body to head fixed it.

About the code difference I have no idea why, in GA you get different codes ?

Thanks for the fix.

Crotan 02-21-2011 11:24 PM

Quote:

Originally Posted by TeknoSounds (Post 2152281)
Okay to fix the <body> issue:
AdminCP -> Plugin Manager -> Edit BBR Google Analytics
Find
Code:

$BBR_find='<body>';
and change it to
Code:

$BBR_find='</head>';
What I'm worried about is the change between the latest file on here and my version...the function difference is this:
Mine & on Google's site
Code:

(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);
})();

versus whats in the latest file on here:
Code:

  (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';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
  })();

Note the last line there....

Do this still work? Or did 4.1.2 break it and thus make the developer flee to IPboard?


All times are GMT. The time now is 04:34 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.01284 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
  • (11)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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