GA4 event Validation only returns 204
Asked Answered
G

1

8

GA4 documentation provides an example of how to send requests to the GA4 Measurement Protocol endpoint for validation.

Using the example providing the ids being asked for the response is always a 204 without a body when the documentation reads that there should be a response body with an array called validationMessages.

Does anyone know why the debug endpoint would only ever return a 204?

Grasping answered 5/4, 2022 at 12:59 Comment(0)
D
10

It seems a 204 status code is to be expected from GA4, i.e. no content should be returned.

From inspecting the response given in the Event Builder (https://ga-dev-tools.web.app/ga4/event-builder/) through the Network log in my browser, there is indeed a JSON response including the key validationMessages. I investigated and found the target URL in the Event Builder is actually https://www.google-analytics.com/debug/mp/collect. By sending your data to this URL, you will also receive a 200 HTTP status code and a JSON response with additional information about your request and any potential errors.

TLDR; You should normally receive a 204 HTTP status code, but with the debug endpoint, you will receive a 200 HTTP status code.

Defroster answered 3/6, 2022 at 12:17 Comment(1)
Great. Thank you! That (/debug/) allowed me to see the following error regarding the event name ... Only alphanumeric characters and underscores are allowedLatifundium

© 2022 - 2024 — McMap. All rights reserved.