您好我想在Google Analytics中使用_trackTiming
方法跟踪“用户从定义的起始事件中完成购买所需的时间”。
this blogpost建议的方法:
{{conversionDurationCookie}}
)_trackTiming
方法以跟踪GA中的持续时间。代码1-2
//this is fired at the defined starting point
var cookieName = conversionDurationCookie;
var cookieValue = new Date().getTime();
var cookieExpires = 1000 * 60 * 30;
document.cookie = cookieName + '=' + cookieValue + '; Expires=' + cookieExpires;
代码3-5:
// this is fired at the conversion
t2 = new Date().getTime();
conversionDuration = (t2 – {{conversionDurationCookie}})
ga("send", "timing", ["conversionDuration"], ["conversionDuration"], ["conversionDuration"]);
代码3-5(版本2):
// this is fired at the conversion
var t2 = new Date().getTime();
function conversionDuration(t2 – {{conversionDurationCookie}}) {
ga("send", "timing", ["conversionDuration"], ["conversionDuration"], ["conversionDuration"]);
}
问题1-6
在我做#6之前,逻辑看起来是否正确?代码3-5(版本2)?正确的函数和变量格式?
最佳// H