Open marco-brandizi opened 1 year ago
OK, I've found out what the problem is: GA now demands that the user agent parameter is set to a sensible value, this is now working for me. I would recommend that google-analytics-java sets this by default.
Interesting! That probably explains why I haven't see this. We set user-agent in AnkiDroid (the user of this library that I personally support) so it never failed.
I'd welcome a PR to set a default user agent and add a note saying it is required now and if you don't set it the default is now "<whatever you propose)>"
Thanks for your reply, @mikehardy. I might try crafting a PR, how do you think it's best to introduce that? In DefaultRequest
?
Yeah, that seems right. And thanks!
It will be a breaking change / major version bump so people can get a warning that the module will generate different hits by default now, but I'm okay with that as long as there's a good release note (very easy to do in this case)
Hi all,
I've been banging my head for hours trying to make this to work.
I'm reasonably sure the API is invoked, since I see "invoked successfully with ID XXX" in the logs. Yet, the GA's real-time view doesn't show anything, apparently, Google is entirely and silently ignoring my requests.
The code at issue is an API for an application that also has an UI on top of the API. The UI invokes GA as well (we offer both the UI and programmatic access via API, and we want to track both), using the Javascript code provided by Google instructions here, and using the same GA ID that instead doesn't work when used with google-analytics-java.
I've tried all combinations I can imagine:
X-Forwarded-Host
(see the linked code)DefaultRequest
I'm embedding your library in my Maven project with:
I'm not sure if the latest release works with the current GA API, or if at least a rebuild from sources might work.
Any help very appreciated, many thanks.