Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support Validating Hits endpoint #48

Open
rashtao opened this issue Mar 22, 2018 · 2 comments
Open

support Validating Hits endpoint #48

rashtao opened this issue Mar 22, 2018 · 2 comments
Milestone

Comments

@rashtao
Copy link

rashtao commented Mar 22, 2018

Is now available a new endpoint to validate the Google Analytics Measurement Protocol requests:
https://developers.google.com/analytics/devguides/collection/protocol/v1/validating-hits.

In the GoogleAnalyticsConfig one can set the http url, eg:

GoogleAnalyticsConfig()
                .setHttpUrl("http://www.google-analytics.com/debug/collect")
// ...

but then the http response from the server is mapped to GoogleAnalyticsResponse, that only keeps the status code and the request params. So atm it is impossible to check the response payload and thus validating the hit.

A really easy modification to the code would be just adding a field to GoogleAnalyticsResponse containing the original org.apache.http.HttpResponse.

@brsanthu
Copy link
Owner

Can you please submit a PR if you have dug deeper? If not, will try to update it some time to enable testing.

@brsanthu
Copy link
Owner

Added setHitDebug config flag. If sets, it sends the requests to debug url (which can be set as well but has defaults). Either way, GAResposne will return httpResponse which has body.

Also added model classes so you can deserialize from json into objects at .hitdebug package. Deserialization itself is not part of the library to avoid the dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants