使用 Google Analytics 在客户端 javascript 和服务器端跟踪调用中跟踪相同的会话? [英] Using Google Analytics to track the same session in client javascript and server side tracking calls?

查看:20
本文介绍了使用 Google Analytics 在客户端 javascript 和服务器端跟踪调用中跟踪相同的会话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在我们的网站 (Barclays CPI) 中实施第 3 方支付系统.我们想使用谷歌分析来跟踪付费客户的来源,例如;关键字、电子邮件活动等.但是,巴克莱 CPI 通过服务器到服务器的 http 请求返回支付授权结果,而不是带有谷歌分析代码的普通网页.这打破了分析链,我们丢失了识别访问者的客户端 cookie.

We are implementing a 3rd party payment system into our site (Barclays CPI). We want to use Google Analytics to track where paying customers came from eg; keywords, email campaigns etc. However, the Barclays CPI returns the payment authorisation result via a server-to-server http request, not a normal web page with google analytics code. This breaks the analytics chain, we lose the client cookie that identifies the visitor.

在 Barclays CPI 确认屏幕上,用户可以按继续按钮返回我们的网站,我们可以在其中放入 javascript 跟踪代码,但按继续按钮是可选的强>.我们需要 100% 准确的分析统计数据用于预算、规划和报告目的.

On the Barclays CPI confirmation screen the user can press a Continue button to return to our site, where we could put javascript tracking code in, but pressing the Continue button is optional. We need 100% accurate analytics stats for budgeting, planning and reporting purposes.

服务器端跟踪呼叫救援?

我知道可以进行服务器端跟踪调用,例如;http://www.diaryofaninja.com/projects/details/ga-dot-net,但我想将服务器端跟踪调用链接到同一个浏览器分析会话,以便我们知道付费客户来自哪里,并且可以在付款前跟踪他通过网站的路径.

I know that it is possible to make server side tracking calls, eg; http://www.diaryofaninja.com/projects/details/ga-dot-net, but I want to link the server side tracking calls to the same browser analytics session so we know where the paying customer has come from and can trace his path through the site prior to payment.

在用户访问第 3 方站点之前获取所有 google cookie 的值,然后以某种方式将它们附加到服务器端分析调用,以便付款授权结果连接到同一浏览器,这是一个好主意吗?会议?这可能吗?

Is it a good idea take the value of all the google cookies just before the user went to the 3rd party site, and then somehow attach them to the server side analytics call so that the payment authorisation result is connected to the same browser session? Is this possible?

谢谢

推荐答案

让这个工作.使用 Google Analytics for mobile 中的 ga.aspx 作为一个基础,您可以存储来自浏览器会话的原始 utma 和 utmz cookie 值,并以可以在浏览器外部检索的方式存储它们.就我而言,订单 ID.然后你需要向 google 发出一个 __utm.gif 图像请求以在浏览器之外进行跟踪.要保留与原始用户相同的分析会话详细信息,请获取存储的 utma 和 utmz 值,并将它们放入 __utm.gif 请求的 utmcc 参数中.您需要先对值进行 url 编码,例如;

Got this working. Using ga.aspx from the Google Analytics for mobile as a base you can store the original utma and utmz cookie values from the browser session and store them in a way you can retrieve outside of the browser. In my case, the order id. Then you need to make a __utm.gif image request to google to track outside of the browser. To keep the same analytics session details as the original user, get the stored utma and utmz values and put them in the utmcc parameter for the __utm.gif request. You'll need to url encode the values first eg;

url += "&utmcc=" + Uri.EscapeDataString( utma + utmz) 

这篇关于使用 Google Analytics 在客户端 javascript 和服务器端跟踪调用中跟踪相同的会话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆