gpt4 book ai didi

google-analytics - 使用 curl 和增强的电子商务跟踪购买服务器端

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

阅读此文档后:https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#enhancedecom

我正在尝试像这样将数据发送到谷歌分析:

$data = array(
"v" => 1,
"tid" => "XX-xxxxx-x",
"cid" => "999",
"t" => "pageview",
"dh" => "mydemo.com",
"dp" => "/receipt10",
"dt" => "Receipt%20Page10",
"ti" => "T12367",
"ta" => "Google%20Store%20-%20Online",
"tr" => 40.39,
"tt" => 2.85,
"ts" => 5.34,
"pa"=>"purshase",
"tcc" => "SUMMER2013",
"pr1id" => "P1265445",
"pr1nm" => "Android%20Warhol%20T-Shirt 2",
"pr1ca" => "Apparel",
"pr1br" => "Google",
"pr1va" => "Black",
"pr1ps" => 2);

$content = http_build_query($data);
$content = utf8_encode($content);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://ssl.google-analytics.com/collect");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, utf8_encode($content));
//curl_setopt($ch,CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);

这是部分工作:我在实时 View 中获得了成功,我可以在“所有页面” View 中看到该页面,但在电子商务 View 中什么也看不到。

我错过了什么?

最佳答案

您将需要等待。数据需要 24 - 48 小时才能显示在标准报告中。它仍在处理中。

如果它是实时工作的,那么您明天可能会在电子商务下看到它。

关于google-analytics - 使用 curl 和增强的电子商务跟踪购买服务器端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45460640/

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