调用远程 JavaScript
基本上,Google Adwords 会为您提供一个代码,以便您可以跟踪您的广告活动的效果。 您可以在订单感谢页面上进行跟踪和订购,这样您就可以看到哪些关键字带来了最多的订单。 它给了我这样的代码:
<!-- Google Code for Purchase/Sale Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = xxxxxxxxxx;
var google_conversion_language = "en";
var google_conversion_format = "1";
var google_conversion_color = "666666";
var google_conversion_label = "purchase";
//-->
</script>
<script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height="1" width="1" border="0" src="http://www.googleadservices.com/pagead/conversion/xxxxxxxxxx/?label=purchase&guid=ON&script=0"/>
</noscript>
当用户点击我的一个广告时,它会使用他点击的关键字等设置一个cookie,然后当他在感谢页面上到达这一点JS时,它意识到他有一个cookie并且进行必要的跟踪。
问题是,对于我现在正在推广的东西,订单感谢页面不在我的服务器上。 我可以在页面上放置 JavaScript 来跟踪订单,但只能采用以下格式:
<SCRIPT language="javascript" src="xxxx"></SCRIPT>
“xxxx”位是我唯一可以更改的内容。
如果我把Google JS代码放在我服务器上的一个文件中,然后从他的感谢页面中调用我服务器上的文件,会达到同样的效果吗? 如果没有,有什么办法可以使用我现有的资源来做到这一点?
Basically, Google Adwords give you a code so you can track how well your campaigns are working. You put in on your order thank you page to track and order, so you can see which keywords bring in the most orders. It gives me a code like this:
<!-- Google Code for Purchase/Sale Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = xxxxxxxxxx;
var google_conversion_language = "en";
var google_conversion_format = "1";
var google_conversion_color = "666666";
var google_conversion_label = "purchase";
//-->
</script>
<script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height="1" width="1" border="0" src="http://www.googleadservices.com/pagead/conversion/xxxxxxxxxx/?label=purchase&guid=ON&script=0"/>
</noscript>
When the user clicks one of my ads it sets a cookie with the keyword he clicked from etc, and then when he reaches this bit of a JS on the thank you page it realises he has a cookie and does the necessary tracking.
The problem is, for the thing I'm promoting right now the order thank you page is not on my server. I can place javascript on the page to track orders but only in the following format:
<SCRIPT language="javascript" src="xxxx"></SCRIPT>
With the 'xxxx' bit being the only thing I can change.
If I put the Google JS code in a file on my server, and then call the file on my server from his thank you page, will it achieve the same effect? If not is there any way to do this using what I have available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您不跟踪价格或任何内容,而只是跟踪页面点击定义的转化,那么您也可以采用 iframe 路线。 让客户端站点打开一个指向您的服务器的 iframe,其中包含 googel 代码。 但就我个人而言,我认为像素选项更好,只要谷歌不禁止或忽略它(你必须尝试找出是否是这种情况)
If you are not tracking prices or anything but just conversions as defined by a page hit, then you could also go the iframe route. Have the client site open an iframe pointing to your server which then includes the googel code. Personally though, I think the pixel option is better, so long as it is not disallowed or ignored by Google (you will have to experiement to find out if this is the case)