A very small and quick addon that introduces a couple of admin settings to add a Google Analytics tracking code to the pages of the forum.
By default admin pages are excluded (I should have excluded the moderation center as well...), but there is a checkbox to enable the tracking here as well.
And another option is to track only guests. I'm not sure if the specular (track only registered members) is worth. Let me know. ;)
Repository:
https://github.com/emanuele45/GAnalytics
Fastest addon ever released :D
I'll try it ;) thank you!
lol
That was easy. ;D
Sweet :)
Good work
@emanuele :thumbsup:
Useful :)
There is small 'typo' in uninstall instructions, there should be <remove-file but it is <require-file
/edit:
One more typo, also in uninstall instruction. After LANGUAGEDIR/english there should be / :)
/me blames copy&paste... O:-)
The addon is not working. I enter the code and press save, but it doesn't save it.
Updated with the fixes from
@phantom thanks!
@Alphonse is the code you have any different from the "UA-1234567-1" structure?
Strange, it works fine here...
Try copy and pasting the example in the comment next to the field.
I see the problem.
is saves when I type UA-1234567-1
but when I type mine it doesn't. I believe it 's cause mine has 8 numbers in the middle, UA-12345678-1
Ahh!
I'm not much into GA stuff, so I thought they were all the same, but I also expected some may be different. lol
Quick fix, open the GAnalytics.integrate.php and change the two 7 here:
https://github.com/emanuele45/GAnalytics/blob/master/GAnalytics.integrate.php#L54
and here:
https://github.com/emanuele45/GAnalytics/blob/master/GAnalytics.integrate.php#L71
to 7,8 (seven comma eight)
@emanuele It works now, thanks for your help :D
Thanks for the add-on (and the fix)
Same issue with the 8 digit code instead of 7. Might be nice to have this fixed...
I'm not a fan of fixing my bugs. :P
You can change the line suggested and have it up-and-running while waiting for me to fix the package. ;)
I'll fix it sooner or later. Hopefully sooner now that 1-1 B1 is out. O:-)
Yeah I got it working. Just thought it deserved a bump after 2 years :)
Thanks for the addon, i think 7,8 fix the issue for me. Hope it runs without any issues.
Any good guide on how to use this Google Analytics? I haven't got a chance to explore this thing yet. :(
Do you mean a guide on how to use analytics or a guide on how to use this addon?
How to create and use GA. This addon should follow only after I learned that.
From what I remember, it is as simple as signing in with a Google account. Something like as in for Adsense. As for using, you will get a dashboard by default. It has a lot of useful information related your website.
I had some facebook page for some domain but I also dont know how to use it like GA. If anybody can give a good link on how to use and utilize GA will be much appreciated.
https://www.google.com/intl/en/analytics/#?modal_active=none
Maybe the references list on the GA wiki site has some useful links too:
https://en.wikipedia.org/wiki/Google_Analytics
@ahrasis , give this a try. Have screen shots
http://www.dkssystems.com/how-to-use-google-analytics-for-beginners
Wow. Thank you
@meetdilip and
@Jorin , they are useful info indeed. Will try it out soon.
Here is the updated version (value changed to 7,8)
French translation in attachment
So which one works? I have tried to install and uninstall them it doesnt work at all. Is there a chance we can add the analytics code directly without using the addon?
the one Jason posted should work fine, I use this addon on two forums and it works great
Yeah I tried that too. I only need to put the UI-XXXXXXXXX-XX right? It doesnt work at all and I dont know why.
yes, go to Administration Center >> Configuration >> Add-on Settings >> Miscellaneous
(Link-4631) can you be more specific with:
?
Did the UA Code still show up after you clicked on save?
Usually repeat the installation doesn't really fix anything (unless a new version is involved). :)
You can always: edit the template and put it where you prefer. :)
I use this to insert Google Analytics code: http://addons.elkarte.net/feature/BKE-Elk-Global_Header_and_Footer.html
I just installed this addon using the compatibility mode on 1.1 RC2 and seems to work fine ;)
i have the same problem. the code is not saved. is this fixed?
--
edit
this one works:
on the addon site: http://addons.elkarte.net/enhancement/Google-Analytics.html it's still version 0.0.1.
/me has to update a lot of things. :'(
This is my first post, so hi everyone and thanks for this wonderful forum software.
My google tracking code has 9 digits (UA-123456789-1) and I've tried this addon (versions 0.0.1 and 0.0.3) in Elk 1.0.10 and recently in 1.1 without success. I've also tried by editing GAnalytics.integrate.php and extending the regex to a broader matching (UA-\d{6,10}-\d), without success either. The global header/footer addon is a no-go because in 1.1 malforms the pages and only shows blank. Any suggestions?
Edit: the tracking code is saved fine in admin/miscellaneous settings.
Hi and welcome :D
I've made a quick attempt to update the addon to install on 1.0 and 1.1 as well as use the async version of the GA tracking code. There was a left over debug statement in .0.0.3 that may have caused problems. I also consolidated the regex check to a string since it was used in a few spots and seems to need to be updated from time to time.
Anyway give this version a try!
That did the trick! I updated the version info to 0.0.4 in package-info.xml to allow installation over existing 0.0.3 versions. Thanks a lot!
@emanuele What's the easiest way for you to merge this update on Github? A pull request?
If you want, sure! :D
Done, cheers!
Is the save issue fixed? Or when we click save it gets saved?
I'm using this add-on on elkarte 1.1.3 but after the upgrade from 1.0.10 and after installing this add-on my analytics code was already there, so I didn't have to touch anything.
Install it and let us know if it works for you ;)
It didn't showed any "Settings saved" message. But i checked in Analytics and it works without any issue :)
Heres the version modified for 9 digit numbers, I've checked it and google detected the number on 1.1.3
IE: UA-123456789-X