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 Pyth
In the present you can use Google Analytics Measurement Protocol. There are some python libraries to send events, for example xoxzo.galib:
client = HitClient('UA-12345678-1')
client.send_hit('event', event_category='auth', event_action='signup')
Or google-measurement-protocol or you can write requests yourself with python-requests by this guide.