English 中文(简体)
为什么谷歌分析跟踪页面浏览 取自我的外地订单表格?
原标题:Why won t Google Analytics track page views from my off-site order form?

我一定做错了什么。 我试图使用 Google 分析器追踪由 InpulSoft (我们的 CRM/etc 提供商) 主持的一个表格在其域内的点击率。 我们希望在 GA 中从一个单独的域追踪点击率 。

这里的表格是: 我们的订单表格

我尝试了 GA 代码的几种表格, 首先是 Async 片断, 然后是传统的片断, 现在又回到 Async 。 下面是我要使用的 Async 代码( 在 < code@ lt;body> 标签中) :

页面顶部附近

<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push([ _setAccount ,  UA-XXXXX-1 ]);
_gaq.push([ _setDomainName ,  oursite.com ]);
_gaq.push([ _setAllowLinker , true]);
_gaq.push([ _trackPageview ,  /saleform/67 ]);
</script>

进一步下页

https://ssl.google-analytics.com/ga.js type= text/javapict></ satict>

<强度 > 相关信息

  • Using Firebug or Chrome s dev tools, I don t see any errors coming from GA when using this code.
  • Tracking is already working on oursite.com, but does not receive data from this page.
  • In Firebug s console, _gaq and _gat seem to be working fine (no errors, they appear as objects with a lot inside)
  • __utm.gif is NOT being requested. I know this is a Bad Thing but am unsure what to do about it.
  • Using a Firefox extension to view cookies, I do NOT see any cookies being set for the domain specified in the above code (or the site hosting the form). edit: after including _setAllowLinker on our site, cookies DO seem to be working (showing up on the page)

补充 , 我尝试过手动从 JS 控制台( 没有运气 -- -- 该页面没有出现在 GA 中) 发射 < codegaq. push ([ [_ trackPageview, / saleform/67 ] ); 方法 。

请告诉我这篇文章中是否缺少任何相关信息, 我很乐意更新, 感谢各位事先提供任何见解,

最佳回答

在对各页的代码大打折扣之后,我找到了一个让我满意的解决方案。我会详细介绍这起案件中似乎有不同作用的三件事。

希望这能帮到外面的人 如果能帮上忙 请别忘了投票

  1. 在我们自己的网站上设置普通 GA 代码, 包括

  2. 在订单表格上(由InnutionSoft(就我们而言由InpulSoft主持)按其网站的指示设立了GA代码,但包括

  3. <强度 > 进口: 加插点击处理器, 以javascript 调用 ([_link, http://your.link.tld/etc]); ;

对于第3点,我用jQuery的片段来识别网页上订购表格的链接,并将GA函数调用单击() -- -- 代号如下。

<script>
jQuery(document).ready(function() {
  jQuery("a[href*= /sale-form ], 
    a[href*= /another-order-form-link ],
    a[href*= your_site.infusionsoft.com/saleform/ ]").click(function() {
      _gaq.push([ _link , this.href]);
      return false;
    });
});
</script>

代码排除:

  • wait for the page to be ready
  • search for any links with href containing your search terms (more on that here
  • bind the _gaq.push([ _link , this.href]); function call to the onClick event handler for any links that were found in the previous step

附加注释 : 如果您包含此 jQuery 代码, 您将不得不装入 jQuery 库。 另外, 如果您在. js 文件 中包含此内容, 显然要删除 标记 。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.