SiteCatalyst:跟踪Webkit浏览器上的自定义链接 [英] SiteCatalyst : Tracking Custom links on Webkit browsers

查看:123
本文介绍了SiteCatalyst:跟踪Webkit浏览器上的自定义链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的查询是我有一个重定向到另一个页面的链接.在Webkit浏览器中,如何强制站点催化剂服务器调用(脚本执行)在重定向发生之前完成?

My query is that I have a link that redirects to another page. In webkit browsers, how to force the sitecatalyst server call (script execution) to finish before the redirect happens?

我正在使用sitecatalyst作为门户.我有 配置了自定义链接调用以包括针对以下内容的doneAction参数 在Webkit浏览器上成功完成呼叫(如Adobe指南中所述).

I am using sitecatalyst for a portal. I have configured the custom link call to include the doneAction parameter for successful call completion on webkit browsers (As mentioned in Adobe guide).

按钮的onClick事件的自定义链接代码如下:

The custom link code for onClick event of button is as below:

<script language="javascript" >
function search(keyword)
{
var s=s_gi('testing');
s.linkTrackVars="prop11,events";
s.linkTrackEvents="event6";
s.prop11=keyword;
s.events="event6";
s.tl(this,'o','Search',navigate());

window.location=searchresults.html;
}
</script>

<script language="javascript" >
function navigate()
{
return false;

/*To induce a delay to ensure that image request is sent to Adobe before the
user leaves the page.(As given in Adobe guide - code release H.25))
Code version H.25 (released July 2012) includes an overloaded
track link method ( s.tl ) that forces WebKit
browsers to wait for the track link call to complete.)*/
}
</script>

但是,即使在此之后,我在自定义链接跟踪中也遇到了错误.重定向发生在呼叫可以完成之前.

However, even after this, I am getting error in custom link tracking. The redirect happens before the call can complete.

请帮忙.预先感谢.

关于, 哈希尔(Harshil)

Regards, Harshil

推荐答案

好的,首先,实现它的方式存在很多问题.这是一个看起来像这样的示例:

Okay so firstly there are a number of issues with how you implemented it. Here is an example of how it should look like:

<a href="searchresults.html" onclick="search('someKeyword');return false;">search</a> 

<script type='text/javascript'>
function search(keyword) {
  var s=s_gi('testing');
  s.linkTrackVars="prop11,events";
  s.linkTrackEvents="event6";
  s.prop11=keyword;
  s.events="event6";
  s.tl(this,'o','Search',null,navigate);
  return false;
}

function navigate(){
  window.location="searchresults.html";
}
</script>

一些要点

  • 您实际上并没有发布链接或使用任何调用search函数的功能,因此我以链接为例.
  • 您应将navigate函数作为第4个参数传递给第5个参数(第4个参数使用空或空白字符串作为占位符)
  • 它应该是navigate而不是navigate().这样做的方式是,您要对函数进行调用,并将函数的结果作为参数传递. s.tl需要实际功能或对功能的引用,它将调用该功能.公平地说,是对Adobe文档进行了拼写:它显示了用引号引起来的示例,但该示例无效.
  • 重定向应放置在navigate中,而不是在search中.
  • You didn't actually post the link or whatever you are using that calls the search function so I have a link shown as an example.
  • You passed the navigate function as the 4th argument when it should be the 5th (with a null or blank string as a placeholder for the 4th)
  • It should be navigate not navigate(). The way you did it, you are making a call to the function and passing the result of the function as an argument. s.tl requires the actual function or reference to a function, and it will make the call to the function. In fairness, the Adobe document is typoed: it shows the example wrapped in quotes which doesn't work.
  • The redirect should be placed in navigate, not in search.

这篇关于SiteCatalyst:跟踪Webkit浏览器上的自定义链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆