[英]Client side to server side google analytics MP client ID
I am trying to send transaction data to UA from a webshop which is only creating orders once it has received a "push" from a payment processing API. 我试图从网上商店向UA发送交易数据,该网上商店仅在收到来自付款处理API的“推送”后才创建订单。 A success page is displayed to the customer independently from the order being created, meaning the tracking script (UA via GTM with data layer) does not have access to the order data.
成功页面将独立于正在创建的订单显示给客户,这意味着跟踪脚本(通过带有数据层的GTM的UA)无法访问订单数据。
This gives me the headache of trying to track transactions made through the webshop server side, instead of client side. 这让我很头疼,试图跟踪通过网店服务器端而不是客户端进行的交易。 Yet I still want to tie the transaction to the unique visitor ID who made the purchase, not just a random Client ID each time.
但是,我仍然希望将交易与购买商品的唯一访客ID相关联,而不仅仅是每次都随机获得一个客户ID。
My site is using analyics.js (UA profile). 我的网站正在使用analyics.js(UA配置文件)。 Therefore I thought somewhere a client ID would be stored as a cookie, and I do see a _ga cookie there which I believe is the client ID, which looks like this:
因此,我认为某个客户端ID将以cookie的形式存储,并且确实看到了一个_ga cookie,我相信这是该客户端ID,看起来像这样:
GA1.2.1586737968.1429871710
The documentation for getting cookie and user identification states the following: 获取Cookie和用户标识的文档规定以下内容:
You should not directly access the cookie analytics.js sets, as the cookie format might change in the future.
您不应该直接访问cookie analytics.js集,因为cookie格式将来可能会更改。 Instead, developers should use the readyCallback to wait until analytics.js is loaded, and then get the clientId value stored on the tracker.
相反,开发人员应使用readyCallback等待加载analytics.js,然后获取存储在跟踪器上的clientId值。
... which is not helpful to me, as I have to do this server side. ...这对我没有帮助,因为我必须在服务器端进行操作。 But anyway, this client ID does not even fit the description of what a client ID looks like , although it does appear to match a legacy format .
但是无论如何,尽管此客户ID看起来确实与旧格式匹配,但它甚至不符合客户ID的描述 。 Sort of.
有点。
Couple of questions then: 然后有几个问题:
Answers: 答案:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.