Ajax 请求上的 GA 跟踪代码?
我有这个:
<!-- Google Code for Tilmeldinger nyhedsbrev Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ /
var google_conversion_id = 982857669;
var google_conversion_language = "da";
var google_conversion_format = "1";
var google_conversion_color = "ffffff";
var google_conversion_label = "e90GCIP3jwMQxe_U1AM";
var google_conversion_value = 0;
if (20) {
google_conversion_value = 20;
}
/ ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/982857669/?value=20&label=e90GCIP3jwMQxe_U1AM&guid=ON&script=0"/>
</div>
</noscript>
我将它插入到ajax请求的页面上,并在响应中看到这个脚本^。
但它不跟踪或计算任何东西?
我应该怎么办?
I have this:
<!-- Google Code for Tilmeldinger nyhedsbrev Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ /
var google_conversion_id = 982857669;
var google_conversion_language = "da";
var google_conversion_format = "1";
var google_conversion_color = "ffffff";
var google_conversion_label = "e90GCIP3jwMQxe_U1AM";
var google_conversion_value = 0;
if (20) {
google_conversion_value = 20;
}
/ ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/982857669/?value=20&label=e90GCIP3jwMQxe_U1AM&guid=ON&script=0"/>
</div>
</noscript>
I inserted it on the page the ajax request to, and in the response I see this script^.
But it does not track or count anything?
What should I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当 AJAX 请求返回时,脚本不会被执行。您可以尝试找出原因,或者我认为
位无论如何都完成了大部分工作,因此您可以尝试删除其余部分并将图像放入页面中:
这应该是问题将跟踪数据发送到 AdWords 的图像请求。
The script's not being executed when the AJAX request returns. You can either try and figure out why, or I think the
<noscript>
bit does most of the work anyway so you could try removing the rest and just placing the image into your page:This should issue an image request that sends the tracking data to AdWords.
您可以使用 GA 事件的跟踪。以下是您需要的所有信息:http://code.google.com/ apis/analytics/docs/tracking/eventTrackerGuide.html
我建议您编写小函数:
并调用 event() 函数。
You can use the GA event's tracking. Here is all info you need: http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html
I suggest you to write small function:
And jsut call event() function.