Google has finally deprecated their GAPI interface which this used to talk to Google Analytics, sorry folks, it will no longer work. See the New Google Analytics for Status Board Server Edition for an updated version.
Dropbox went down today, and I found out when my Status Board stopped updating. This spurred me on to migrate my Google Analytics for Status Board scripts from Ruby and Dropbox over to server based PHP. Huge thanks to Carl Franzon for the starter code.
Warning: This version of the scripts requires PHP v5.3. It also uses a hacked version of the Google GAPI library that runs against the Google v2.4 API. The current Google API is v3, but that requires complex OAuth2 access, which is a pain in the gazoot to implement. Expect Google to deprecate the old API, probably tomorrow and without notice.
Quick Install Instructions
- Download the statusboard.zip file.
- Expand it in the root of your web server. It creates a
- Edit each of the
analytics_*.phpfiles with your login and password.
- The URL to use in Status Board is
<your-domain>with your server domain name, and
<file>with one of
You should get something like this (Yes, my follower count is still tiny. Yes, I live in New York, but I still use Celsius for weather.):
There are four files in the archive:
analytics_views.phpto present a graph of Page views, Visitors and New Visits for the past week for a site.
analytics_hourly.phpto present the same data over the last 24 hours.
analytics_pages.phpto show the top pages today.
gapi.class.phpis required to access Google Analytics, but this one has been hacked to use the v2.4 API.
For each of the
analytics_*.php pages, change the first few lines with your own information:
1 2 3 4 5 6
If you have more than one Google Analytics profile (i.e. more than one site), you may need to change the profile, with 0 being the first profile in your list. I also recommend setting the timezone to your server timezone so that you don’t fill your web logs with PHP errors.
Why choose these technologies?
I chose to use PHP, which I intensely despise, because that’s the language most likely to be enabled on your web host. As it is on mine.
I used the GAPI library because it works without OAuth. For now.
If you’d prefer a more modern and robust approach, stick to the previous Ruby and Dropbox workflow at Google Analytics for Status Board.