My Google Analytics module - with dashboard graph
Hello there,
i noticed the FuelCMS Google Analytics module provided here
https://github.com/daylightstudio/FUEL-CMS-Modules-Pack doesn't really work (at least here...)
So i took inspiration from PyroCMS's builtin Google Analytics module and ported it to FuelCMS.
If anyone's interested i'll put it up for you to download - let me know
UPDATE You can find it on GitHub :
https://github.com/pierlo-upitup/google_analyticsBasically it allows you to see the last month's page views / unique visits graphed by jQuery Flot.
Here's a screenshot
Note to admin: may I suggest to have forum category for the community to share useful modules? That would be so awesome, really!
Comments
There is a share category in the forum. However, we don't have an infrastructure to better facilitate the sharing of those modules. We've been talking about that here for a while, but...well we haven't gotten to it.
admin, i've sent you a PM about the module.
Talking about the module sharing platform, an idea could be to have an open collaboration of coders from the community work on it...
Or maybe just a moderated sticky post of modules submitted by the community could be enough for now
yours is a little more advanced, I planned on adding that extra functionality as well for my module - but if you feel like sharing yours...
I think a community driven sharing platform is a great idea, and would happily help where is needed. Truthfully, it would probably be a while before we at Daylight would be able to develop something to fit the communities needs so this would probably be a better solution.
https://github.com/pierlo-upitup/google_analytics
Hope you find it useful.
I'm planning to add some extra features to it - basically the same stuff @webcam's own GA module as shown in the picture above and possibly on-the-fly timeframe adjustment.
- This module is designed for the dashboard. So you need to add it do the 'dashboards' key in your MY_fuel.php config, eg
$config['dashboards'] = array('google_analytics');
Since you're overriding the fuel default, if you want those back, it looks like
$config['dashboards'] = array('google_analytics','fuel','backup');
Plus using the Tracker ID instead of the profile ID:
The Profile ID location is in the URL when you're logged in:
For the NEW VERSION analytic page it is the number at the end of the URL starting with p https://www.google.com/analytics/web/#home/aXXXXXXXXwXXXXXXXXpXXXXXXXX/
I tried using it, but the script still failed. Gives an error connecting to GA.
Looks like GA updated their API to a new version which isn't compatible with the older one. Not sure if that's the cause of the errors.
You need to log in on your Analytics account, click on the profile for the domain, and look at the URL. Simply grab that number after the 'p' at the end and paste it under inside google_analytics/config/google_analytics.php
if you did that and it still fails, are you sure the password provided is the right one? And what about the tracking code ?
http://support.google.com/analytics/bin/answer.py?hl=en&answer=1032385
SMH
https://github.com/pierlo-upitup/google_analytics
Also, if you use FUEL's command line tool to install, it will automatically add it to the $config['modules_allowed'].
php index.php fuel/installer/install google_analytics
https://developers.google.com/analytics/devguides/reporting/core/v2/gdataProtocol
https://developers.google.com/gdata/articles/using_cURL
https://developers.google.com/gdata/docs/developers-guide
In my testing of it, it seems to get hung up on the second CURL request to retrieve the visitor data (or any data). I'm able to get the Authentication CURL request, but the second one to retrieve the data just hangs. Could be a change in how Google handles it.
Updating the Analytics library didn't help either:
https://github.com/pyrocms/pyrocms-ci/blob/22c5b2bedf4b7a059bb4b58518f95e8070750512/system/cms/libraries/Analytics.php
The embed API seems like a simpler alternative: https://developers.google.com/analytics/devguides/reporting/embed/v1/