gpt4 book ai didi

google-analytics - 在谷歌分析中发送自定义变量gif请求时是否需要utmt参数?

转载 作者:行者123 更新时间:2023-12-03 02:58:30 25 4
gpt4 key购买 nike

我正在尝试使用自定义变量在服务器端使用谷歌分析。

Google 对 utmt 参数的说明如下:

Indicates the type of request, which is one of: event, transaction, item, or custom variable. If this value is not present in the GIF request, the request is typed as page.

但是,当我使用 http header 时,即使在定义自定义变量时,也看不到发送 utmt 参数。有必要吗?如果是这样,您能否提供一个查询字符串示例?

编辑:这是我正在使用的 JavaScript 代码:

<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-123456789-1']);
_gaq.push(['_setCustomVar', 1, 'Test', 'Test', 2]);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();

</script>

最佳答案

与文档所建议的相反,您无法在综合浏览或事件跟踪之外设置自定义变量。并且 _setCustomVar 本身不会调用 GA 服务器。
utmt参数值只能是'event'、'item'、'transaction',如果不设置则有一个pageview值。

自定义变量通过页面 View 或事件的调用传递(简单地 explained here )

在您的示例中,自定义变量是通过 _trackPageview 调用发送的(您可以在 utme=8(Test)9(Test)11(2) 中查看它) ).
Pageview 是 utmt 的默认值,因此无需在此处指定。

注意:文档中的“自定义变量”请参阅old _setVar function已弃用。

关于google-analytics - 在谷歌分析中发送自定义变量gif请求时是否需要utmt参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10549674/

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