Module: Google Analytics Module
mcp
Joined: 2009-07-06
Posts: 3 |
Posted: Mon, 2009-07-06 22:48 |
Hi, I've created a little Module which renders the Google Analytics Code at the end of each page. I have hidden the attachment to this post as it does not work with the latest version of G3. |
|
Posts: 16504
Cool, only briefly looked at the code. Does it support SSL?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 3
I only copied the original Google code which supports SSL afaik
Posts: 16504
ah, perfect, looking at google_analytics_theme.php it appears it should be just fine. I'll have to test this out once I get my ssl cert on my new server.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 27300
Great! Thanks for the contribution. Can you create a codex page for this module? That would help out a bunch.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 3
after some trouble ;) : http://codex.gallery2.org/Gallery3:Modules:google_analytics
Posts: 27300
Thanks!
Posts: 7994
Great work! I've added this to our contrib repository here:
http://github.com/gallery/gallery3-contrib/tree/3ec8ccfff8e1dbffc5d24d22976579b79aee6ade/modules/google_analytics
I did some minor style cleanup to get it in line with our current style, and I tweaked the installer a bit. If you'd like to make changes there, create a fork, make changes, then submit a pull request and I'll pull them in.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!
Posts: 4
I'm having a problem with adding this one.
After activating the module it doesn't show up in the 'Settings' menu.
EDIT: Got it working via /gallery3/index.php/admin/google_analytics. But it's still not showing up in the Settings drop-down menu.
Posts: 27300
Seems to work for me. At lease the code is added to my page, don't know if it works or is correct but the code does get added.
Try an experimental version of G3:
FAQ: How do I upgrade?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 573
Brilliant module here ... thanks. Statistics are roling in
and what a nice presentation by Google analytics. This is a must have for anyone that wish to learn and improve from your site trafic.
I wondered: Does the module track admin traficking? That will ofcourse influence statistics in a non-realistic way. Could this be changed if in case, so that admin trafic is left out of the loop
all the best
HB - http://www.image.agentura.dk
Posts: 573
Note: statistics for Lightbox triggered image views are not triggered. Should this be handled by the theme or this module?
I posted this for 3nids theme:
<quote>
Images are triggered in the light box. Therefore, view count is not triggered. I get statistics for viewed albums, next, previous etc. Image views is not tracked... and views are indicated as 0 views.
Can this be fix'ed for Gallery as well as googleanalytics module???
</quote>
all the best
HB - http://www.image.agentura.dk
Posts: 12
A request:
Recently google had released an asynchronous version of their analytics code (snippet). Since we are using that & that code has to be included before the </head>, we cannot use this module.
More info:
http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html
http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=161379
Will implementing this be possible?
Thank you!
Posts: 58
[img]http://www.imagehut.eu/images/99142ga_gallery.gif[/img]
By default it just shows an empty field and there's no link to click on.
I can change the (empty) value by using:
gallery3/index.php/admin/advanced_settings/edit/google_analytics/code
But this is probably not the way it should be. ;-)
Is it true that I only have to enter my tracking-code and not the whole script provided by Google?
Posts: 16504
This should be fixed. Please grab the latest experimental code:
http://github.com/gallery/gallery3/zipball/master
Upgrading instructions here:
http://codex.gallery2.org/Gallery3:Upgrading
Bug info here: http://sourceforge.net/apps/trac/gallery/ticket/987
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 424
google analytics does not show up under settings after activating the module. I had to go into the advanced settings to enter my UA number. I'm on the experimental code as of last night, 6/19/10.
Posts: 135
I had to do what Shemo725 did - I'm running 3.0 RC2 (Santa Fe).
I was also able to hit this URL and enter my Google code: /gallery/admin/google_analytics.
If either of the above was done the code showed up on all Gallery pages above the footer section in my Theme.
Once the above is working, it would be very nice to see stat charts and data displayed within the Admin.
Posts: 58
After upgrading gallery from Version #21 to #41 (V3.0) I got an error for the google_analytics module!
An error occurred while installing the Google Analytics module
Anybody else with the same problem?
Posts: 80
I had the same problem. Module was probably not adapted to the latest version.
Posts: 135
Working for me, I'm running Analytics v2 and final release of G3.
After upgrading a banner appeared in the admin notifying of available module upgrades and linked to an auto upgrade page (nice!) and I upgrade from Analytics v1 to 2.
Posts: 12
I'm having a strange issue with the gallery3 auto updater.
I'm seeing this message:
Some of your modules are out of date. Upgrade now!
But when I click on Upgrade now, it's showing
Module name: Installed version Available version
Gallery 3: 41, 41
Google Analytics: , 1.2
No version indicated in the installed version so G3 continues to think i'm out-dated.
I'm just ignoring the message for now but did i setup it up wrong?
Posts: 27300
There was some issues with this module and the above .zip file does not work right.
I have fixed it below in the attachment:
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 80
Module activated, but where are the settings?
Posts: 27300
Did you read the documentation?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 80
You mean this "After activation, you can setup the module under Settings -> Google Analytics."?
As I wrote earlier (maybe not too clear), I do not have such a choice on the menu.
Posts: 58
Thanks Dave! Great!
Everything's fine now!
What do you think, is it possible to make the current version downloadable from the website too, rather than just from the forum? http://codex.gallery2.org/Gallery3:Modules:google_analytics
Posts: 27300
fixed the codex page to point to my post. Is that what you are after?
I have asked bharat to update the GIT as well, b ut he is out of town for the next few days.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 58
More or less, yes! I just love to have a direct download-link. [img]http://img88.imageshack.us/img88/4148/zwinker.gif[/img]
Otherwise everybody has to skim all the posts in this thread first, just to get the files. And I'm always a bit unsure if I really got the latest version?! This would be much more convenient with a direct link.
Posts: 253
Hello Dave,
Just as surgeon, I don't have any "Google Analytics" in my Settings menu.
I just can find it in the "advanced" menu.
So what should I put as the code : is it just the client number or the hole code that Google Analytics suggest you to paste at the end of your pages ?
such as :
thank you in advance for your answer
-----------------
Posts: 2
Hi Dave ...
same problem here ...
no entry in the settings menu ...
gallery3 version 41 ...
google analytics version 2.0 ...
cheers
Alexx
started with G1 and NO knowledge -
now CSS-styling of G2/G3
Posts: 3
I am not sure this is correct but I went to Modules and then checked the box next to "Google Analytics 2 Renders the Google Analytics Code at the end of the page." then I clicked the update box at the bottom. After that I went to Settings=>Advanced=>scrolled down to "google_analytics code " and clicked on the word "empty". when you click on the word empty you get a pop-up box (check your pop up blocker) and in the box that says "code" I enter my "Profile ID #". Like I said, am not sure if this is correct or not.
Posts: 80
Albin11z: Maybe this is correct, but we don`t have `Settings=>Advanced=>scrolled down to "google_analytics code"`.
Posts: 3
It worked for me with G3 final build. Thanks
Posts: 27300
Typo try
http://gallery.menalto.com/files/google_analytics_0.zip
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 3
Thanks.
Posts: 80
Solved.
Posts: 3
I downloaded the new zip file from "http://gallery.menalto.com/files/google_analytics_0.zip" and then removed the previously uploaded version and uploaded the new version, but There was no difference. I then decided to compare the files using hash values. I compared "http://gallery.menalto.com/files/google_analytics_0.zip" to the google_analytics.zip I downloaded prior to the "typo try" post and the hash values for each and every file was identical (meaning there was no difference).
The only difference was the folder name google_analytics and google_analytics_0 So I removed google_analytics and uploaded google_analytics_0 to see if I would get better results, and as I suspected there still is no difference.
Surgeon... any chance you can tell me what you did to get it working.
Posts: 80
Albin11z: simply overwrite the old files with new ones.
Posts: 3
I did that, but nothing changed. I also compare the old files and the new files using a HASH compare and found the files to be identical. So over writing ifles with the same file is not going to change anything.
Posts: 1
I found that adding a folder under the modules folder, I named it "googleanal" and then extracted files to this folder the modules page showed the "Google Analytics" option.
Posts: 693
I just registered for Google Analytics and the code they just gave me to include was somewhat different to what the module produces. GA doesn't seem to be detecting the module's code. It won't be hard to update the module, but before I do this has anyone else found this? Am I right in concluding that GA has changed its code recently?
U-G
Posts: 693
Yesterday this didn't seem to be working but today it is. I still have the impression that there is a newer version of the GA code, and I suspect that the module will need to be updated at some stage. The code I was given when I signed up to GA was:
whereas the module uses
The other option that would be nice to include in the module would be the ability to disable the code for the image owner or admin or whatever. I guess that shouldn't be hard.
U-G
Posts: 27300
The original author does not seem to be keep up to date, so, care to take over development/updates to the module?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 693
I guess so. I don't think it *needs* any changes at the moment. I need to better understand the differences in the two versions of the GA code before I go making any new changes. The code to disable owner views is fairly simple. I might try and include it in the admin module as a learning exercise. But it's my turn to travel and this will have to wait.
U-G
Posts: 693
I managed to find some time before I left to code a new version (version 3). This version uses the latest version of the Google Analytics code. I've also added an option in the module's admin page to disable the GA code if the viewer is either the active user or an admin.
It seems to be working, but if anyone has problems with this new version in the next week or so while I am travelling I may or may not be in a position to assist.
There are in fact two versions of the GA code, with the other one being what you use if you have multiple sites under the one domain - e.g. www.mydomain.com and gallery.mydomain.com and perhaps also blog.mydomain.com. I'll have a go at adding this option after I have solved some more general problems with .html suffixes.
If anyone has the .html suffix option enabled in config.php then you may need to temporarily disable it in order to access the admin page for this module. Once you've set the options for the GA module, then you can turn html back on - as this GA module works fine with that html suffix config option. [I have two sites - a production site plus a test site that is a clone of the prod site - and on the test site I don't need to disable .html to access this module's admin page, but I do on the virtually identical production site. Go figure!]
U-G
Edit: I've worked out why the GA code in this new version of the module is different to that in the initial version - Google changed the code in Dec 2009 to asynchronous code to speed things up. Details here: http://googlecode.blogspot.com/2009/12/google-analytics-launches-asynchronous.html
So this should speed things up a little - in theory.
Posts: 61
Thanks! Giving it a go ...
Posts: 13
Hi I've recently installed this module with the latest gallery release, but GA is not tracking the gallery pages at all. I also use the same tracking code for the domain e.g. www.domain.co.uk (which tracks fine) and www.domain.co.uk/gallery3. It's not a sub-domain so that shouldn't cause issues but I don't know why else it wouldn't track? Any suggestions appreciated.
ETA - Solved. I had to create a separate profile for the gallery and the domain and track them as though they were two different sites.
Posts: 7994
Comments are now permitted for this topic.
Posts: 15
I just downloaded this module for my gallery3 install that is on a subdomain.
According to a page source, I can see the GA code presented at the bottom of the page, but my Google Analytics Admin console still says the code is missing.
The only difference I can see is that the Google Code has single quotes, but my page source shows double quotes around the code.
my gallery is at http://gallery.w2lie.net
Thanks
Posts: 1
I just downloaded and extracted it into the modules directory, but am unable to see it in the modules page. I put another module in there to see if it would show up (adsense) and it showed up just fine... i tried changing the directory name to googlea and that didn't work either...
Posts: 1
Anything for adwords conversion tracking?