Recent Topics

[Plugin] Google Analytics code plugin

Started by on Apr 30, 2008 – Contents updated: Mar 24, 2018

Apr 30, 2008 21:55    

Did your Google Analytics code survive your latest upgrade? Is it still there when you changed your skin? No worries anymore. This plugin will inject the Google Analytics code into every page in your blog, even in the Admin section.

[url=http://www.sonorth.com/travel/download/IHWCAK52OK]Download v1.0.0[/url]

When you subscribe to Google Analytics you get a snippet of code that goes at the bottom of the page. At the moment there is a deprecates snippet and a new one. Of course the plugin uses the new one. This is how the snippet looks:

PHP

<script type="text/javascript">
 
  var _gaq _gaq || [];
  _gaq.push(['_setAccount''UA-XXXXX-X']);
  _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 document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gas);
  })();
 
</script>

You will need to copy/paste the pageTracker code. Formerly known as _uacct, but the code didn't change. It's the code that looks like UA-1234567-1 in this snippet. You add that to the setting of the plugin:

http://www.blog.hemminga.net/B2evoforum/GoogleAnalytics.png

Changelog:

v1.0.0
New: support to new (asynchronous) tracking code syntax
New: per-blog plugin settings. If needed, you can enter different code for each blog
New: you can add custom params like _gaq.push(['_setDomainName', 'example.com']);

v0.1
Initial release

Apr 30, 2008 22:28

looks cool, thank you Afwas, another useful plugin

May 06, 2008 22:33

Cool Afwas!

What I want is different settings of analytics for each blog :)

DO you have any idea of how to implement that?

[]'s
- Walter

May 07, 2008 01:43

I'll try, Walter, but I haven't got a clue yet how it should scale to, say, 500 blogs.
I think if you have 500 bloggers you want a widget in a newly to be created container. That'll give them their own options and responsibility. If it's more like ten blog for you as Admin only, then an option in the Plugin Settings will do.

I'll think about it.

May 07, 2008 05:52

Cool :)

One note: the plugin is pretty good as-is :)

May 13, 2008 09:55

I'm using b2evolution 2.4.2 and I installed this plugin.

I have put in the _uacct code in the plugin screen and have waited for more than 24 hours (in fact, it's already been more than 48 hours now). But when I click on "Check Status" button in Google Analytics page, it will always tell me that my tracking code is not installed.

What have I missed? Is there any other settings I need to do in the Plugin screen in b2evolution Admin?

Please help.

May 13, 2008 16:11

The URL - jinnpod.com

Thanks.

May 13, 2008 16:28

Well, nothing is showing up in your source code for your blog.
1. Check that your Google Analytics stuff is correct for your url
2. Double check your _uacct code is in fact correct.

I could see the Analytics code in the source of my site before it started working, after 24 odd hours.

May 13, 2008 16:42

Can I just check with you guys and see if I did everything correctly?

1. Google Analytics site - in my website URL I put www.jinnpod.com. Is this correct? Do I have to put the add the /index.php?

2. In b2evolution admin, I installed the plugin and configured the _uacct code. That was all I did. Do I have to configure anything else?

May 15, 2008 15:40

Hi jim,

In you skin add in between:

Code

<!-- footer ends here -->
  
<!-- wrap ends here -->

PHP

<?php
// Trigger plugin event, which could be used e.g. by a google_analytics plugin to add the javascript snippet here:
$Plugins->trigger_event('SkinEndHtmlBody');
?>

Then it should work.

Good luck

May 16, 2008 06:12

Hi Afwas

Thanks for your tips. I'm travelling for the next 5 days, so I can only try this out when I'm back home. I'll report my results then.

Cheers!

Jun 29, 2008 17:56

just an FYI, this code wasn't in my theme (PixelGreen) either, adding it was necessary.

Jun 30, 2008 09:34

Hi all

Just wanna update that it is now working after adding the codes as instructed by Afwas.

Thanks!

Jun 30, 2008 15:46

Nice to hear. Thanks for reporting back.

Have a nice day.

Apr 09, 2009 22:13

I ran into the same issue with the Modern Furniture skin, made the change, and it looks like the code is showing up in source now. Now to wait for google to catch on.
Thanks!

Apr 22, 2009 20:00

I'm still not getting it recognized by Google.

Sep 05, 2009 15:01

I'm having the same issue after I upgraded to 3.3.1. I have the code inserted into my pixelgreen skin (it was already there) and have the plugin activated with my tracker code.

anyone have any suggestions? thanks.

Sep 17, 2009 01:09

Google is still not working for me;

In 3.3, do we still you the code in between:

Code:
<!-- footer ends here -->

<!-- wrap ends here -->

PHP:
<?php
// Trigger plugin event, which could be used e.g. by a google_analytics plugin to add the javascript snippet here:
$Plugins->trigger_event('SkinEndHtmlBody');
?>

??

Can we do this from the admin or agggh open the web development software?

Thanks,Brian
Brian

Feb 05, 2010 20:12

jack376 wrote:

I'm having the same issue after I upgraded to 3.3.1. I have the code inserted into my pixelgreen skin (it was already there) and have the plugin activated with my tracker code.

anyone have any suggestions? thanks.

It doesnt work
Where is the author?

Feb 27, 2010 01:28

Afwas wrote:

Hi jim,

In you skin add in between:

Code

<!-- footer ends here -->
  
<!-- wrap ends here -->

PHP

<?php
// Trigger plugin event, which could be used e.g. by a google_analytics plugin to add the javascript snippet here:
$Plugins->trigger_event('SkinEndHtmlBody');
?>

Then it should work.

Good luck

I found this code in my HTML_FOOTER file in the Skins directory. I installed the plugin and placed my UA code and Google still says not tracking. Any help?

Sep 29, 2010 15:05

Not sure if anyone is interested but I have updated this plugin to use the latest google analytics asynchronous javascript code.

I did contact the author about the update but haven't had a response as of yet so if anyone wants it I can put a release together.

L

Oct 25, 2010 08:30

Hi Lee,

You've had a response already. Please do fix and maintain this plugin.

Have a nice day

Mar 29, 2012 02:46

Is there an updated version of this plugin that use the asynchronous javascript code?

Mar 29, 2012 21:52

There were no updates.

In b2evolution 5 you can enter any code to load either in <head> section or before closing body (this is where you want to put GA scripts).

Anyway, I'll probably release an updated version of the plugin in a few days.

Mar 29, 2012 23:22

Plugin updated to v1.0.0

New: supports new (asynchronous) tracking code syntax
New: per-blog plugin settings. If needed, you can enter different code for each blog
New: you can add custom params like _gaq.push(['_setDomainName', 'example.com']);

Mar 31, 2012 08:14

cool, thanks for the time-saver

Aug 21, 2012 17:13

can you pint me to where the plug in should show up after i've uploaded tot he plugin directory? The menu i have is Blog Settings -> Plugin Settings but it's not showing up.

update - found it Global Settings -> Plugins. Installed and updated the UA code and hit save.

question is - it's not showing up in the output of the code. any suggestions?

URL: www.goorin.com/blog

also tried clearing cache. tried unchecking SkinEndHtmlBody,

UPDATE: i modified the custom skin to include the code. seems we implemented solution with bypassing main Skin codeset. file i updated was blog/skins/_html_footer.inc.php

happy trails!

Mar 24, 2018 00:49

@sam2kb Where is the code for this plugin? Most of the links I have found are dead :(

Mar 24, 2018 03:09

I am afraid @sam2kb has moved on to other things and is no longer active in these forums.


Form is loading...

powered by b2evolution – This forum is powered by b2evolution CMS, a complete engine for your website.