1
votes

I am sending a POST request to the Google analytics measurment protocol at

https://www.google-analytics.com/collect?v=1&t=event&tid=UA-151666808-2&cid=123&el=cus&ea=CLIENT_REGISTRATION_SUCCESS3&ec=Server

However it is not being tracked on my site. I am sending it with Java API. I use rest template, feingClient, gama-client-core, google-analytics-java libraries. The result is always the same - the event does not track. If I change mine tid to another, then the event is displayed in another resource. Or if I call this link through POSTMAN, then the result is also successful.

2
What Java library are you using to? I was not aware of any official java library for the measurement protocol. - DaImTo

2 Answers

2
votes

The debug call for your request looks fine.

{
  "hitParsingResult": [ {
    "valid": true,
    "parserMessage": [ ],
    "hit": "/debug/collect?v=1\u0026t=event\u0026tid=UA-151666808-2\u0026cid=123\u0026el=cus\u0026ea=CLIENT_REGISTRATION_SUCCESS3\u0026ec=Server"
  } ],
  "parserMessage": [ {
    "messageType": "INFO",
    "description": "Found 1 hit in the request."
  } ]
}

Data Processing time.

Check the real time api to ensure that the hits are being recorded if they are then you are all set. Then wait 24 - 48 hours for the data to complete processing you should see it in the standard reports then.

bot filtering

Make sure you have disabled bot filtering on the view

enter image description here

New google analytics account

It takes up to 72 hours for an account newly created in Google analytics to start showing data.

0
votes

Quoted from google measurement protocol reference

Note that Google has libraries to identify real user agents. Hand crafting your own agent could break at any time.

You should change the request User-Agent to a browser like one so google doesn't think you are a bot.