Monday, 19 August 2013

How to post to Google Measurement protocol using Pyhton?

How to post to Google Measurement protocol using Pyhton?

Measurement protocol guide
I need an example of how a POST would look using Python.
Something like this, but working.
import httplib, urllib
conn = httplib.HTTPConnection("www.google-analytics.com")
conn.request("POST",
"v=1&tid=UA-XXXXXX-Y&cid=666&t=event&ec=game&ea=start&ev=0")
response = conn.getresponse()
print response.status, response.reason
data = response.read()
conn.close()

No comments:

Post a Comment