Answer the question
In order to leave comments, you need to log in
Measurement Protocol not showing analytics?
Hello! There is a site made on django, there is a need to send requests from the backend. To do this, we decided to use the Measurement Protocol. Here is the send function:
def send_event(cid, ec, ea, el=None):
data = {
'v': 1, # API Version.
'tid': settings.ANALYTICS_TRACKING_ID, # Tracking ID / Property ID.
# Anonymous Client Identifier. Ideally, this should be a UUID that
# is associated with particular user, device, or browser instance.
'cid': cid,
't': 'event', # Event hit type.
'ec': ec, # Event category.
'ea': ea, # Event action.
'el': el, # Event label.
'ev': 0, # Event value, must be an integer
}
requests.get('http://www.google-analytics.com/collect', params=data)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question