Rob
Rob

Reputation: 70

Google Analytics post request not appearing

I'm sending an event request to Google Analytics server-side using a POST request to https://www.google-analytics.com/collect from Python/Flask (via the requests library). I'm testing it by looking at the real-time events page.

{
  "hitParsingResult": [ {
    "valid": true,
    "parserMessage": [ ],
    "hit": "/debug/collect?v=1\u0026tid=UA-18542058-16\u0026cid=ax5b51b5beaa4f0\u0026t=event\u0026ec=Tasks\u0026ea=View task\u0026el=25\u0026ev=0"
  } ],
  "parserMessage": [ {
    "messageType": "INFO",
    "description": "Found 1 hit in the request."
  } ]
}

The request is: https://www.google-analytics.com/debug/collect v=1&tid=UA-18542058-16&cid=ax5b51b5beaa4f0&t=event&ec=Tasks&ea=View+task&el=25&ev=0.

I cannot figure out what I'm doing wrong here. Any ideas?

Upvotes: 1

Views: 474

Answers (1)

Michele Pisani
Michele Pisani

Reputation: 14179

Try to specify dl (document location URL) parameter in the hit or both dh (document host name) and dp (document path) parameters: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters?hl=it#dl

Alternative disable any filter in the view and the tick to exclude bots.

Upvotes: 1

Related Questions