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.
I wanted to see the 7-day Hiltmon.com web stats from Google Analytics on Panic’s new Status Board app. Here is how I got it to work.
Update: For a far simpler install that runs on your web server using PHP, see Google Analytics for Status Board Server Edition.
Warning: Very geeky. Use at your own peril. Only tested in my environment.
Step 1: Install the Gems
In order to make this work, you need Ruby, the
json gem and the
gattica gem. I am running this using the default Ruby on OS X (1.8.7).
json gem is easy:
$ sudo gem install json
gattica gem requires a build because the posted one is too old:
$ git clone git://github.com/chrisle/gattica.git $ cd gattica/ $ bundle install $ gem build gattica.gemspec $ sudo gem install gattica-0.6.2.gem
Update: Added the
bundle install step to install dependencies. No need to install the old gem first as per old instructions and comments below. You may need to
sudo bundle install on a production box.
Step 2: Configure the Script
Download the script from this gist or copy and paste it from here:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
Edit the script to change:
- The email and password you use to access Google Analytics.
- The title, file_name and dropbox_path to save the data on your computer and dropbox.
Note: This script uses the first account. If you want to use a different account, comment out line 43 and uncomment line 44, replacing the
1 with the index of the account you want to use. Download, modify and run the script from https://gist.github.com/hiltmon/5373934 to see what indexes are available.
Run the modified script to see if both the CSV and JSON get created in the required dropbox folder.
Step 3: Schedule it to Run
We’re going to run this script every 5 minutes. Note: These are the OS X instructions, use a
crontab entry on Linux systems.
Create the following file
com.hiltmon.status_board_ga.plist (modified for your path of course):
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Then copy it (you may need to create the folder) and start it:
$ cp com.hiltmon.status_board_ga.plist ~/Library/LaunchAgents $ launchctl load -w ~/Library/LaunchAgents/com.hiltmon.status_board_ga.plist
Step 4: Add it to Status Board
Follow the instructions in Graph Tutorial (PDF):
- Share the JSON file on your DropBox
- Mail that link to yourself
- Tap the link in the email on your iPad to open it in Safari
- Copy the link from Safari (minus the bit after the
- Add a new graph to your Status Board and paste in the link (it offers to do this by default).
Thanks to Panic for creating such a lovely tool.
Update: All the scripts can be downloaded from Github at https://github.com/hiltmon/status-board-ga.