I'm developing a site that has a REST API and I'd like to track the API usage using Google Analytics events. Is there a straightforward way to trigger GA events from Python that doesn't involve loading up an entire webbrowser
component just to send a javascript request?
The Google Analytics Reporting API v4 provides programmatic methods to access report data in Google Analytics (Universal Analytics properties only). With the Google Analytics Reporting API, you can: Build custom dashboards to display Google Analytics data. Automate complex reporting tasks to save time.
This project called PyGA is much better. Unlike "Google-Analytics for Mobile" project on github it is well documentated and has rich API.
There is an open source implementation of Google-Analytics for Mobile in python available here: http://github.com/b1tr0t/Google-Analytics-for-Mobile--python-
You can probably integrate this into your own setup by importing 'track_page_view' and providing it with the appropriate WSGI request environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With