I
I
IvanOne2016-09-23 13:40:00
Django
IvanOne, 2016-09-23 13:40:00

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)

I start the function, the event goes away. But in the analytics itself, cid = 555 is empty, I tried their validator, it says that everything is OK, the request is correct. Who worked with this protocol, are there any pitfalls?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question