- If you have a programmable door lock in the office, you can track employees' office hours.
- Track the commits of your team. Tag with branch/hash etc.
- Track your own computer usage
Google Analytics is mostly used with a JavaScript snippet on the client side but if you browse the documentation, you'll see that they also provide mobile tracking features which help you to collect data without a web browser or even if the client doesn't support JavaScript.
Basically, mobile client displays an image which is served by a server-side script hosted by you and the script pushes the visit data to Google via GET request. The parameters of this method is listed on the Troubleshooting the Tracking Code section of the documentation.
After looking at this list, PHP/Perl codes provided by Google with some trial and error I've found the minimum parameters to push data.
- utmwv, tracking code version.
- The latest version at the time of this writing is 5.2.2d.
- utmn, unique ID generated for each GIF request to prevent caching of the GIF image.
- Example value in the documentation is 10 digits so stick to maximum of 10 digits.
- utmp, requested path of the current page.
- utmac, account string (property id).
- utmcc, cookie values.
- __utma is required. These 2 posts discusses this cookie in detail.
- "1" can be used for each part except unique visitor id.
- For the visitor id, you can generate something unique for each visitor which doesn't change between visits. The safe assumption for the length of the id 10 because google Analytics itself uses around 10 digits.
After this data is generated, simply request http://www.google-analytics.com/__utm.gif with these parameters in the query string.
Here is the proof of concept Python code:
If you read this post from any non-js environment, you can visit the gist for this code.
I've provided you the bare minimum. Now you can add more variables and track whatever you need. Don't forget to share your hack in the comments.
Here is the proof of concept Python code:
If you read this post from any non-js environment, you can visit the gist for this code.
I've provided you the bare minimum. Now you can add more variables and track whatever you need. Don't forget to share your hack in the comments.