gpt4 book ai didi

curl - 谷歌测量协议(protocol)给出奇怪的 react

转载 作者:行者123 更新时间:2023-12-03 17:26:14 25 4
gpt4 key购买 nike

我正在尝试使用 php7 和 guzzle 为我的 rest API 进行设置。当我使用 cli 在 curl 中将请求发送到调试 url 时,我得到了一个不错的 json 响应

{
"hitParsingResult": [ {
"valid": true,
"parserMessage": [ ],
"hit": "/debug/collect?v=1\u0026t=pageview\u0026tid=UA-1234567-1\u0026uid=UA-1234567-1\u0026dh=test.domain.com\u0026dp=/api/user/verify/flow"
} ],
"parserMessage": [ {
"messageType": "INFO",
"description": "Found 1 hit in the request."
} ]
}
但是如果我将它发送到产品 url,我每次都会得到奇怪的响应
GIF89a▒▒▒▒▒,D;
有谁知道如何解决这个问题?
这是我在 cli 上运行的
curl -X POST -d 'v=1&t=pageview&tid=UA-xxxxxxxxx-1&uid=UA-xxxxxxxxx-1&dh=test.domain.com&dp=%2Fiwsapi%2Fuser%2Fverify%2Fflow' https://www.google-analytics.com/debug/collect
对于非 Debug模式,我只是删除调试
curl -X POST -d 'v=1&t=pageview&tid=UA-xxxxxxxxx-1&uid=UA-xxxxxxxxx-1&dh=test.domain.com&dp=%2Fiwsapi%2Fuser%2Fverify%2Fflow' https://www.google-analytics.com/collect
在guzzle中,我正在 build 它
$promise = $guzzle->post("/debug/collect", [
'proxy' => [
'http' => 'http://proxy:8080',
'https' => 'http://proxy:8080',
],
'form_params'=>[
'v'=>1,
't'=>'pageview',
'tid'=>GOOGLE_ID,
'uid'=>$_SERVER['HTTP_CTVFNTUSERNAME'],
'dh'=>WWWHOST,
'dp'=>$_SERVER['REQUEST_URI'],
//'dt'=>'homepage'
]
]);

最佳答案

Response Codes

The Measurement Protocol will return a 2xx status code if the HTTP request was received. The Measurement Protocol does not return an error code if the payload data was malformed, or if the data in the payload was incorrect or was not processed by Google Analytics.

If you do not get a 2xx status code, you should NOT retry the request. Instead, you should stop and correct any errors in your HTTP request.


无论如何,测量协议(protocol)实际上并没有验证您的点击,您将得到的唯一响应是 1x1 像素图像,即 GIF89a▒▒▒▒▒,D ;
所以真的没有什么可以解决它应该的工作。唯一会向您发送正确响应的是您似乎正在使用的调试端点

关于curl - 谷歌测量协议(protocol)给出奇怪的 react ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53741259/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com