GA4事件验证仅返回204
GA4 文档提供了一个示例,说明如何将请求发送到 GA4 测量协议端点进行验证。
当文档显示应该有一个带有名为 validationMessages 的数组的响应正文时,使用提供响应请求的 id 的示例始终是没有正文的 204。
有谁知道为什么调试端点只会返回 204?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎可以从GA4中获得204个状态代码,即不应返回任何内容。
通过检查事件构建器中给出的响应( https://ga-dev-- tools.web.app/ga4/event-builder/ )通过我的浏览器中的网络日志,确实有一个JSON响应,其中包括键
validationMessages
。我调查并发现目标构建器实际上是https://www.google-analytics.com/debug/mp/colect
。通过将数据发送到此URL,您还将收到200 HTTP状态代码和JSON响应,其中包含有关您的请求和任何潜在错误的其他信息。tldr;
您通常应该收到204 HTTP状态代码,但是在调试端点,您将收到200 HTTP状态代码。
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 actuallyhttps://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.