测量协议文档为我提供了发送批处理请求的这些指示:
POST /batch HTTP/1.1
Host: www.google-analytics.com
v=1&tid=UA-XXXXX-Y&cid=555&t=pageview&dp=%2Fhome
v=1&tid=UA-XXXXX-Y&cid=555&t=pageview&dp=%2Fabout
v=1&tid=UA-XXXXX-Y&cid=555&t=pageview&dp=%2Fcontact
我对如何为此建立我的网址有点困惑?
我试过的:
$guzzle = new \GuzzleHttp\Client();
$guzzle->request('POST','www.google-analytics.com/batch',[
'query' => "v=1&tid=UA-XXXXX-Y&cid=555&t=event
v=1&tid=UA-XXXXX-Y&cid=555&t=event
v=1&tid=UA-XXXXX-Y&cid=555&t=event
v=1&tid=UA-XXXXX-Y&cid=555&t=event
v=1&tid=UA-XXXXX-Y&cid=555&t=event"
]);
这不起作用,ga 中应该有 5 个新事件,但我只收到 1 个(第一个)。
如何向测量协议发送批处理请求?