Google Analytics域名跟踪API _link()方法

时间:2022-08-22 11:07:43

Has anyone else had any problems using google's Domain Tracking API, I am specifically talking about the _link() method.

有没有其他人使用谷歌的域跟踪API有任何问题,我特别谈论_link()方法。

The documentation is here

文档在这里

The example provided shows that the _link() method should be used in the onclick event like this:

提供的示例显示_link()方法应该在onclick事件中使用,如下所示:

<a href="http://www.newsite.com" onclick="pageTracker._link('http://www.newsite.com');return false;">Go to our sister site</a>

However, this essentially just makes the link...do nothing (most probably because of the 'return false').

然而,这基本上只是使链接...什么也不做(很可能是因为'返回错误')。

My understanding is that the pageTracker._link() method is 'supposed' to add additional parameters to the url and do it's own document.location style redirect.

我的理解是pageTracker._link()方法'假设'将其他参数添加到url并执行它自己的document.location样式重定向。

Any ideas / catches / previous posts??

任何想法/捕获/以前的帖子?

2 个解决方案

#1


2  

Sorry for the obvious question, but did you enable linking on the target page:

很抱歉这个显而易见的问题,但您是否在目标网页上启用了链接:

You must also enable linking on the target site (pageTracker._setAllowLinker(true);) in order for link to work properly.

您还必须在目标站点上启用链接(pageTracker._setAllowLinker(true);),以使链接正常工作。

#2


2  

Apparently a miss-interpretation of the documentation:

显然是对文档的错误解释:

You must also enable linking on the target site

您还必须在目标站点上启用链接

So lets clarify also

所以我们也要澄清一下

  • pageTracker._setAllowLinker(true); is set on the ORIGINATING page
  • pageTracker._setAllowLinker(真);在ORIGINATING页面上设置

  • pageTracker._setAllowLinker(true); is set on the TARGET page
  • pageTracker._setAllowLinker(真);在TARGET页面上设置

I only had it enabled on the target page, as the docs indicate.

我只在目标页面上启用了它,正如文档所示。

#1


2  

Sorry for the obvious question, but did you enable linking on the target page:

很抱歉这个显而易见的问题,但您是否在目标网页上启用了链接:

You must also enable linking on the target site (pageTracker._setAllowLinker(true);) in order for link to work properly.

您还必须在目标站点上启用链接(pageTracker._setAllowLinker(true);),以使链接正常工作。

#2


2  

Apparently a miss-interpretation of the documentation:

显然是对文档的错误解释:

You must also enable linking on the target site

您还必须在目标站点上启用链接

So lets clarify also

所以我们也要澄清一下

  • pageTracker._setAllowLinker(true); is set on the ORIGINATING page
  • pageTracker._setAllowLinker(真);在ORIGINATING页面上设置

  • pageTracker._setAllowLinker(true); is set on the TARGET page
  • pageTracker._setAllowLinker(真);在TARGET页面上设置

I only had it enabled on the target page, as the docs indicate.

我只在目标页面上启用了它,正如文档所示。