The creatively-named Google Analytics Panel adds an overview of your site’s Google Analytics statistics to a panel on the ExpressionEngine control panel home screen. The panel displays quick stats for Today and Yesterday (visits, pageviews, average pageviews per visit, and average visit length), with increased stats for the past 31 days (visits, pageviews, average pageviews per visit, average visit length, bounce rate, percentage of new visits, top content and top referrers). The 31-day stats also include sparklines to visualize site activity. It’s all very pretty really.
Installation
Upload the Analytics panel extension and language file to /system/extensions/ and /system/language/english/ respectively. Then upload the included /lib/analytics_panel folder to your /system/lib/ directory.
Activate the extension, then visit the Google Analytics Panel settings screen. Enter your Google Analytics username and password and click Submit. Load the settings screen again, and choose the profile you wish to display on the home screen.
The Google Analytics panel will now be available on the My Account -> Customize Control Panel -> Control Panel Homepage screen for each user, and can be set to display in either the left or right column, and ordered just like the default homepage panels.
Now load your home screen, wait for a few seconds (cuz the API is kinda slow), and cry/smile at how un/popular your site is.
Google Analytics Panel has been tested with ExpressionEngine 1.6.8, and requires PHP 5.
Note: if you’re currently using my Custom CP Home Panels extension, be sure to download the latest version (1.0.1) for compatibility with Google Analytics Panel.
UPDATE
Version 1.1 adds the following:
Looking for an EE2-compatible version? Lookie here.
Fantastic extension Derek! I loaded it up and don’t see all of my profiles though. My particular google account is setup as an “admin” to numerous accounts and 4 of my profiles (all under a single account) are not showing up. I don’t know how the Analytics API works so I don’t know what settings to look for in GA. Any thoughts?
Also, in the docs you mention that the API is kinda slow. Have you considered building in a cache to the extension and allow a refresh setting in the extension settings?
Great Job! 😊
Just pushed an update to GitHub to fix this Erik (I was only fetching 20 profiles - now it will fetch 100).
Re: caching - I did consider that, but it definitely makes it less useful. I really wanted to have a “Today” display, and a cache kinda defeats that. Since the home screen isn’t repeatedly loaded as a general rule, I wasn’t going to get my panties in a knot over the slight lag. 😊
Hi there,
Thanks for this extension - been hoping for something like this for a while now!
I’ve installed it, but I can’t seem to get it working. It keeps saying “No account profiles available (check credentials?)” even though I’ve entered the correct username and password, the same details as I use to login to google.com/analytics.
I’ve even tried different variations for the username - username, [email protected], [email protected], etc, but to no avail. Have tried two sets of usernames actually and neither worked when I went back into the settings after saving them (both Administrator roles for the Google Analytics profiles). I’ve also tried disabling and re-enabling the extension, deleting, re-downloading it from GitHub (both zip and tar versions for good measure), and re-installing, but no joy.
I’m using 1.6.8 build 20091002 and the server is running php 5.2.10. Have also got 1.0.1 version of the Custom CP Home Panels installed.
Any ideas?
Thanks.
Is there any way the password can be stored and used in an encrypted format? Unfortunately storing the password in the database is a deal breaker for me for security reasons…
Would base64 encoding do the trick for you? It would be encoded in the database, so peering eyes couldn’t see it, but it can of course be decrypted using base64_decode if someone cared to.
It keeps saying “No account profiles available (check credentials?)” even though I’ve entered the correct username and password, the same details as I use to login to google.com/analytics.
All I can think of is asking if you’re 100%, positively sure that your credentials are correct. 😊 When I was writing this extension, I almost gave up, thinking that something in EE was blocking the authentication routine, until I realized I had transposed two characters in my username.
Google does expect an email address as the account login.
Is there any way the password can be stored and used in an encrypted format? Unfortunately storing the password in the database is a deal breaker for me for security reasons…Would base64 encoding do the trick for you? It would be encoded in the database, so peering eyes couldn’t see it, but it can of course be decrypted using base64_decode if someone cared to.
Well my primary concern is I may have an EE site where multiple people manage extension settings but only one person needs to know the GA info. When loading the settings to this extension the password field would decrypt the password so that it’s correct on submission again. Honestly I know know what the best solution would be here…
Well my primary concern is I may have an EE site where multiple people manage extension settings but only one person needs to know the GA info. When loading the settings to this extension the password field would decrypt the password so that it’s correct on submission again which means the password is visible in the source (value=”the_password”). Honestly I know know what the best solution would be here…Is there any way the password can be stored and used in an encrypted format? Unfortunately storing the password in the database is a deal breaker for me for security reasons…Would base64 encoding do the trick for you? It would be encoded in the database, so peering eyes couldn’t see it, but it can of course be decrypted using base64_decode if someone cared to.
Edit: Great…looks like I click “quote” instead of “edit” on that one. Sorry about that! I wish I could delete accidents like this…
I see what you’re saying. I don’t think there’s really a way around this, besides a far more complicated settings process. Something like: enter credentials, and if they verify, store them and no longer display the username/password box. Then add a “forget credentials” option, which would delete them and offer up the form again.
I’d suggest creating a new Google account for this particular site, and adding that account as a “user” to that site’s profile in GA, then logging in to the extension with that account. That way, access to the password is of no worry.
It keeps saying “No account profiles available (check credentials?)” even though I’ve entered the correct username and password, the same details as I use to login to google.com/analytics.All I can think of is asking if you’re 100%, positively sure that your credentials are correct. 😊 When I was writing this extension, I almost gave up, thinking that something in EE was blocking the authentication routine, until I realized I had transposed two characters in my username. Google does expect an email address as the account login.
Yeah, I’ve checked them and typed them in very carefully (3 different Google accounts now) but with no joy. My very first attempt did use the wrong password though, but the next 10 attempts were definitely correct. 😊
Not to worry, I’ll try it on another site and see if I have any joy there.
Thanks.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.