This is actually a revenge project, earlier this week Google "tricked" me into joining an online course, which because of "Google Analytics" they are well aware I'm a sucker for online courses. So I signed up straight away, but looking at the reply email later that day I started to feel a little regret "Google Analytics" is mostly a marketing tool.

"but,"  I say to myself " an API's an API and I'll find something to do with it".

The course was so informative I thought I'd lost IQ by taking it.

So I set to searching for the API, which wasn't covered at all in the alleged "course", and reclaimed a few braincells by using it to cram Analytics into Arduino and so; "Arduinolitics" was born.

There are certainly limitations to the platform, but also advantages. So far I have been unable to retrieve individual event values, the closest I got was a daily average, daily count or a count of current users.

The main advantage is you need no extra hardware, no server and Google hosts the data for you.

Possible Uses:
"Daily Average" might be good for barometric data? - Tested (example query in code comments).
"Daily Count" could be a good pedometer?
"Current Users" could have an alert set if the "current visitors" count drops below a specified value indicating one of your Arduinos has gone down. - Tested (I'm using it for a reboot counter as I type).

Step 1: Hardware and Accounts

If you already have a network enabled Arduino and Google Analytics account, that you know how to use you can skip ahead to Step 1 and start setting up.

I'm using an EtherMega and there are a cornucopia of networked Arduinos to choose from, otherwise if you need to connect an ethernet shield or wifi shield I'm sure you'll find some way to figure that out.

A Google Analytics account with at least one property set up with Universal Analytics enabled will be handy here. Mine was by default, but your mileage may vary.

Also handy will be the Tracking code for that property. Note however, the property does not seem to be required, I pointed mine to a null.html just in case, however it does not seem to be needed, the events I'm using here function independently.

If you wish to you can leave my tracking code in as I love data, please send your data to me. I'll see if I can make a report for it public somehow. :D

I do however, recommend using your own tracking codes and categories after saying hi to ArduinoNet (It's kind of like SkyNet but friendlier, and hosted on MySQL).

The real fun is watching realtime hits on the live events viewer and basking in the glory of subverting a user tracking system and putting it to real use!

OK, so we've got network connectivity and our accounts sorted, lets upload.

<p>Great work :)</p>

About This Instructable



More by PuZZleDucK::: Arduinolitics ::  Google Analytics on Arduino. 8-Bit Arduino Valentine's Heart 
Add instructable to: