发送离线测量数据 - cid 必须与原始 cid 匹配吗?
sending offline measurment data - does cid have to match the original cid?
我需要根据离线 activity 发送购物车状态更新。我的客户将通过网站在线将商品添加到他们的购物车,但最终结账和购买是离线进行的。
这是我的问题:在下面的示例中,结帐步骤已更新。此步骤中提供的 client_id 是否必须与网络用户最初启动购物车时使用的原始 client_id 相匹配?
衡量结帐选项
v=1 // Version.
&tid=UA-XXXXX-Y // Tracking ID / Property ID.
**&cid=555 // Anonymous Client ID.**
&t=event // Event hit type
&ec=Checkout // Event Category. Required.
&ea=Option // Event Action. Required.
&pa=checkout_option // Product action (checkout_option).
&cos=2 // Checkout step.
&col=FedEx // Checkout step option.
客户端 ID 是 Google Analytics 在多个会话期间跟踪每个用户的方式。所以,是的 - 如果您希望该有效负载与同一用户相关联,那么 CID 将需要匹配 - 否则您将人为地夸大您的用户数量(以及切断来自该用户的上下文数据)。
您可以在您自己的会话数据中解析 cookie that GA stores in the browser to obtain the CID and then fill it there. Not sure what language you're writing in, but there are plenty of snippets out there for parsing the GA cookie. You could also store the CID when it is initially generated,以便稍后在离线时使用。例如:
ga(function(tracker) {
var clientId = tracker.get('clientId');
console.log(clientId);
});
您也可以 provide your own CID 从一开始就自己生成并告诉 Google Analytics 使用。这对你的情况来说可能有点过头了,但我想将其作为一个选项提及。
我需要根据离线 activity 发送购物车状态更新。我的客户将通过网站在线将商品添加到他们的购物车,但最终结账和购买是离线进行的。
这是我的问题:在下面的示例中,结帐步骤已更新。此步骤中提供的 client_id 是否必须与网络用户最初启动购物车时使用的原始 client_id 相匹配?
衡量结帐选项
v=1 // Version.
&tid=UA-XXXXX-Y // Tracking ID / Property ID.
**&cid=555 // Anonymous Client ID.**
&t=event // Event hit type
&ec=Checkout // Event Category. Required.
&ea=Option // Event Action. Required.
&pa=checkout_option // Product action (checkout_option).
&cos=2 // Checkout step.
&col=FedEx // Checkout step option.
客户端 ID 是 Google Analytics 在多个会话期间跟踪每个用户的方式。所以,是的 - 如果您希望该有效负载与同一用户相关联,那么 CID 将需要匹配 - 否则您将人为地夸大您的用户数量(以及切断来自该用户的上下文数据)。
您可以在您自己的会话数据中解析 cookie that GA stores in the browser to obtain the CID and then fill it there. Not sure what language you're writing in, but there are plenty of snippets out there for parsing the GA cookie. You could also store the CID when it is initially generated,以便稍后在离线时使用。例如:
ga(function(tracker) {
var clientId = tracker.get('clientId');
console.log(clientId);
});
您也可以 provide your own CID 从一开始就自己生成并告诉 Google Analytics 使用。这对你的情况来说可能有点过头了,但我想将其作为一个选项提及。