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-01-2011 10:00 PM

Google Analytics in the Archive (and Forum) by BOP5
 
1 Attachment(s)
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)

BirdOPrey5 01-01-2011 11:29 PM

Reserved

raicars 01-02-2011 08:35 AM

Product not work
Demo:

http://www.yhanoi.com/forum/archive/index.php

Dr.osamA 01-02-2011 01:21 PM

1 Attachment(s)
installed + 5 stars
showing only in archive no else

translated to Arabic , plzz be nice and add translation to 1st original post

thank you

Edit : update translated XML file to version 1.13

BirdOPrey5 01-02-2011 01:29 PM

Quote:

Originally Posted by raicars (Post 2142671)

Can you show me a screenshot of the mod setting you are using?

BirdOPrey5 01-02-2011 01:31 PM

Quote:

Originally Posted by Dr.osamA (Post 2142723)
installed + 5 stars
showing only in archive no else

translated to Arabic , plzz be nice and add translation to 1st original post

thank you

Are you saying you tried it in the forum and it didn't work? What VB are you using?

raicars 01-02-2011 03:11 PM

1 Attachment(s)
Images Option

BirdOPrey5 01-02-2011 04:00 PM

OK, I'm not 100% sure what is wrong but I just updated to a new version, 1.13. Please try it now and let me know if it's any better.

raicars 01-02-2011 04:58 PM

I has just update product 1.1.3.
It's not word :d.
http://www.yhanoi.com/forum/archive/index.php

BirdOPrey5 01-02-2011 05:06 PM

Quote:

Originally Posted by raicars (Post 2142819)
I has just update product 1.1.3.
It's not word :d.
http://www.yhanoi.com/forum/archive/index.php

Just FYI it IS working in the forum- I see this code in your "view HTML source" on your forum:

HTML Code:

<!--Google Analytics in (Forum) Begin-->
<script type="text/javascript">
  var _gaq = _gaq || [];

  _gaq.push(['_setAccount', 'UA-11533753-1']);

  _gaq.push(['_setDomainName', 'none']);

  _gaq.push(['_setAllowLinker', true]);

  _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>
<!--Google Analytics in (Forum) End-->

I will continue to see if I can think of anything blocking it in the archive.

BirdOPrey5 01-02-2011 08:41 PM

Quote:

Originally Posted by raicars (Post 2142819)
I has just update product 1.1.3.
It's not word :d.
http://www.yhanoi.com/forum/archive/index.php

Could you try one more thing for me... in the mod settings erase all the google analytics code and replace it with:
Code:

<p> THIS IS A TEST </p>
And then go to your archive and see if you see "THIS IS A TEST" on your page?

Dr.osamA 01-02-2011 11:11 PM

thank you for update

i am using VB 4.1.0
now it is 100% ok

working very good

i will update translated XML file

thank you sir

OldSchoolDSL 01-02-2011 11:47 PM

Installed & working

4.1 PL2

This should be a default setting in vBulletin :)

BirdOPrey5 01-03-2011 03:17 AM

Quote:

Originally Posted by Dr.osamA (Post 2142986)
thank you for update

i am using VB 4.1.0
now it is 100% ok

working very good

i will update translated XML file

thank you sir

Thank you, I have added the translation to the main post. :up:

Quote:

Originally Posted by OldSchoolDSL (Post 2143000)
Installed & working

4.1 PL2

This should be a default setting in vBulletin :)

Thank You. :)

BirdOPrey5 01-04-2011 03:06 AM

Updated again to version 1.3... There was an issue where people who had the "Branding Free" vBulletin license couldn't get this to work in the forums (because the copyright text isn't present.) - I have altered the mod so it will always add the code to the footer regardless of the vBulletin copyright.

If you don't have the branding-free vBulletin license there is no need to upgrade.

OldSchoolDSL 01-04-2011 03:13 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2143674)
Updated again to version 1.3... There was an issue where people who had the "Branding Free" vBulletin license couldn't get this to work in the forums (because the copyright text isn't present.) - I have altered the mod so it will always add the code to the footer regardless of the vBulletin copyright.

If you don't have the branding-free vBulletin license there is no need to upgrade.

Do not think I needed to update, but did anyways.

Didn't un-install the previous version....

Simply imported and told it to over write....

Installed and working

4.1 PL2

Thank you :)

BirdOPrey5 01-04-2011 11:35 AM

Quote:

Originally Posted by OldSchoolDSL (Post 2143676)
Do not think I needed to update, but did anyways.

Didn't un-install the previous version....

Simply imported and told it to over write....

Installed and working

4.1 PL2

Thank you :)

You're welcome.

Please go to your Admin CP -> Plugin Manager, scroll down to "Google Analytics in Archive" and see how many plugins are listed. If there are 2 you're good, if there are 3 then an old one didn't get removed. That was the reason I suggested uninstalling first.

OldSchoolDSL 01-04-2011 03:51 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2143831)
You're welcome.

Please go to your Admin CP -> Plugin Manager, scroll down to "Google Analytics in Archive" and see how many plugins are listed. If there are 2 you're good, if there are 3 then an old one didn't get removed. That was the reason I suggested uninstalling first.

There is only 1

But everything is working, so I'm not worried.

BirdOPrey5 01-06-2011 10:37 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2143674)
Updated again to version 1.3... There was an issue where people who had the "Branding Free" vBulletin license couldn't get this to work in the forums (because the copyright text isn't present.) - I have altered the mod so it will always add the code to the footer regardless of the vBulletin copyright.

If you don't have the branding-free vBulletin license there is no need to upgrade.

Wow... downgraded this back to 1.13- back to the drawing board as the "fix" I put in v 1.3 causes more problems then it fixes. :o

OldSchoolDSL 01-06-2011 10:45 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2145170)
Wow... downgraded this back to 1.13- back to the drawing board as the "fix" I put in v 1.3 causes more problems then it fixes. :o

So I guess I've been lucky!?! (no issues here)

Think I'll keep it and not downgrade just yet.

But I really do want to thank you for all the hard work you continue to put into this mod and others here.

BirdOPrey5 01-06-2011 10:57 PM

Thank you for that. The issue is only related to showing the code outside the archive so if you keep that part disabled you won't have any issues in any version.

In version 1.13 it works fine if you don't have a branding-free license.

In version 1.3 (which I removed) it will display the google code but stop most of the rest of the footer from showing at all.

BirdOPrey5 01-06-2011 11:26 PM

OK... it turned out to be a pretty easy fix... now upgraded to version 1.4... I really think this will be the final version unless some new functionality is asked for.

I suggest everyone upgrade to 1.4, especially if you have version 1.3 OR a branding-free license.

OldSchoolDSL 01-07-2011 02:34 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2145189)
OK... it turned out to be a pretty easy fix... now upgraded to version 1.4... I really think this will be the final version unless some new functionality is asked for.

I suggest everyone upgrade to 1.4, especially if you have version 1.3 OR a branding-free license.

Upgraded....

Import > Allow Over write > YES

Installed and working

4.1 PL2

GoHighVoltage 01-19-2011 03:20 PM

One question, Google says to install it here:

Copy and place the code snippet
Once you find the code snippet, copy and paste it into your web page, just before the closing </head> tag*. If your website uses templates to generate pages, enter it just before the closing </head> tag in the file that contains the <head> section. (Most websites re-use one file for common content, so it's likely that you won't have to place the code snippet on every single page of your website.)
For the best performance across all browsers we suggest you position other scripts in your site in one of these ways:

* before the tracking code snippet in the <head> section of your HTML
* after both the tracking code snippet and all page content (e.g. at the bottom of the HTML body)

BirdOPrey5 01-19-2011 04:05 PM

Google suggests it near the <head> tag so it means the Analytics code will always load and be counted even before the rest of your pages loads. In an ideal world this would be best for you and Google. But in the real world sometimes Google's codes don't load so fast and putting it here would prevent the rest of your page from being displayed until it finishes loading which can cause you to annoy users.

From experience with vBulletin and Google I, and I think most, admins have come to the conclusion it's best in the footer so the page can load before the Analytics code. If a couple of visitors aren't counted because they change pages too fast, so be it.

It definitely works in the footer where this mod puts it, it's where I've always had it and have installed/tested it on numerous forums and used Google's own tools to confirm the code is active and deployed.

8thos 01-20-2011 03:47 PM

Installed.

BirdOPrey5 01-20-2011 09:47 PM

what exact version are you using?

And just to confirm this is viewing online.php?

Does it go away if you turn it off in your forums?

Manandrox 01-21-2011 01:14 PM

Hi Bird!

Ok, I edited my post. I apologize, I was not clear. It is only 1 or 2 people that will show that location.

I am using 4.1. Yes, the online.php? page.

The Google Analytic code, on page view, shows up on the page great! I just disabled it now so I will watch it for a few hours to see. It seems that it was just the registered users that were showing this location.

BirdOPrey5 01-21-2011 05:37 PM

Do you by chance have some sort of mod that attempts to minimize or combine javascripts?

I can't replicate the problem and the file path you posted:
Quote:

/folder/forumdisplay.php/clientscript/vbulletin_css/style00002l/.google-analytics.com/ga.js
shouldn't even exist... :confused:

Manandrox 01-21-2011 07:44 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2152504)
Do you by chance have some sort of mod that attempts to minimize or combine javascripts?

I can't replicate the problem and the file path you posted:

shouldn't even exist... :confused:

Ok, I still get the error with the mod disabled.

Unknown Location

Unknown Location
/folder/member.php/1-user


So it is something else. I will delete my previous post.

Awesome mod though!!! Thanks!!!

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 09:49 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.01461 seconds
  • Memory Usage 1,848KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_html_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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