如何使用omnture中的s.crossVisitParticipation?

发布于 2024-11-05 13:24:10 字数 1503 浏览 5 评论 0原文

我在任何地方都找不到这个函数的文档,我使用的是 1.7 版本,

s.crossVisitParticipation = new Function("v", "cn", "ex", "ct", "dl", "ev", "dv", ""
+ "var s=this,ce;if(typeof(dv)==='undefined')dv=0;if(s.events&&ev){var"
+ " ay=s.split(ev,',');var ea=s.split(s.events,',');for(var u=0;u<ay.l"
+ "ength;u++){for(var x=0;x<ea.length;x++){if(ay[u]==ea[x]){ce=1;}}}}i"
+ "f(!v||v==''){if(ce){s.c_w(cn,'');return'';}else return'';}v=escape("
+ "v);var arry=new Array(),a=new Array(),c=s.c_r(cn),g=0,h=new Array()"
+ ";if(c&&c!=''){arry=s.split(c,'],[');for(q=0;q<arry.length;q++){z=ar"
+ "ry[q];z=s.repl(z,'[','');z=s.repl(z,']','');z=s.repl(z,\"'\",'');arry"
+ "[q]=s.split(z,',')}}var e=new Date();e.setFullYear(e.getFullYear()+"
+ "5);if(dv==0&&arry.length>0&&arry[arry.length-1][0]==v)arry[arry.len"
+ "gth-1]=[v,new Date().getTime()];else arry[arry.length]=[v,new Date("
+ ").getTime()];var start=arry.length-ct<0?0:arry.length-ct;var td=new"
+ " Date();for(var x2=start;x2<arry.length;x2++){var diff=Math.round((td."
+ "getTime()-arry[x2][1])/86400000);if(diff<ex){h[g]=unescape(arry[x2][0"
+ "]);a[g]=[arry[x2][0],arry[x2][1]];g++;}}var data=s.join(a,{delim:',',"
+ "front:'[',back:']',wrap:\"'\"});s.c_w(cn,data,e);var r=s.join(h,{deli"
+ "m:dl});if(ce)s.c_w(cn,'');return r;");

这是我的调用代码。

s.eVar33 = s.crossVisitParticipation(s.campaign, 's_evar33', '30', '10', '>', 'purchase');

它一直不返回任何内容,我们将不胜感激。谢谢

I cannot find documentations for this function anywhere, I am using version 1.7

s.crossVisitParticipation = new Function("v", "cn", "ex", "ct", "dl", "ev", "dv", ""
+ "var s=this,ce;if(typeof(dv)==='undefined')dv=0;if(s.events&&ev){var"
+ " ay=s.split(ev,',');var ea=s.split(s.events,',');for(var u=0;u<ay.l"
+ "ength;u++){for(var x=0;x<ea.length;x++){if(ay[u]==ea[x]){ce=1;}}}}i"
+ "f(!v||v==''){if(ce){s.c_w(cn,'');return'';}else return'';}v=escape("
+ "v);var arry=new Array(),a=new Array(),c=s.c_r(cn),g=0,h=new Array()"
+ ";if(c&&c!=''){arry=s.split(c,'],[');for(q=0;q<arry.length;q++){z=ar"
+ "ry[q];z=s.repl(z,'[','');z=s.repl(z,']','');z=s.repl(z,\"'\",'');arry"
+ "[q]=s.split(z,',')}}var e=new Date();e.setFullYear(e.getFullYear()+"
+ "5);if(dv==0&&arry.length>0&&arry[arry.length-1][0]==v)arry[arry.len"
+ "gth-1]=[v,new Date().getTime()];else arry[arry.length]=[v,new Date("
+ ").getTime()];var start=arry.length-ct<0?0:arry.length-ct;var td=new"
+ " Date();for(var x2=start;x2<arry.length;x2++){var diff=Math.round((td."
+ "getTime()-arry[x2][1])/86400000);if(diff<ex){h[g]=unescape(arry[x2][0"
+ "]);a[g]=[arry[x2][0],arry[x2][1]];g++;}}var data=s.join(a,{delim:',',"
+ "front:'[',back:']',wrap:\"'\"});s.c_w(cn,data,e);var r=s.join(h,{deli"
+ "m:dl});if(ce)s.c_w(cn,'');return r;");

here is my calling code.

s.eVar33 = s.crossVisitParticipation(s.campaign, 's_evar33', '30', '10', '>', 'purchase');

It keeps returning nothing, help would be appreciated. Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遥远的她 2024-11-12 13:24:10

除非得到 Omniture 实施顾问的支持,否则不应使用此插件。不过话虽如此,这就是我所拥有的:

/* Plug-in Example: crossVisitParticipation v1.7  
In the following sample call:  
A list of s.campaign values will be returned.  New s.campaign values will be appended to
the list.  The list will be stored in a cookie named "s_ev22".  Each s.campaign value will
be stored for 30 days and a maximum of 5 values will be stored in the campaigns list.  If
event2 is set the list will be cleared, and sequential duplicate values are allowed.

s.eVar22=s.crossVisitParticipation(s.campaign,'s_ev22','30','5','>','event2',1);
*/

另请注意,您需要有替换插件才能使其工作。

/*
 * Plug-in: crossVisitParticipation v1.7 - stacks values from
 * specified variable in cookie and returns value
 */

s.crossVisitParticipation=new Function("v","cn","ex","ct","dl","ev","dv",""
+"var s=this,ce;if(typeof(dv)==='undefined')dv=0;if(s.events&&ev){var"
+" ay=s.split(ev,',');var ea=s.split(s.events,',');for(var u=0;u<ay.l"
+"ength;u++){for(var x=0;x<ea.length;x++){if(ay[u]==ea[x]){ce=1;}}}}i"
+"f(!v||v==''){if(ce){s.c_w(cn,'');return'';}else return'';}v=escape("
+"v);var arry=new Array(),a=new Array(),c=s.c_r(cn),g=0,h=new Array()"
+";if(c&&c!=''){arry=s.split(c,'],[');for(q=0;q<arry.length;q++){z=ar"
+"ry[q];z=s.repl(z,'[','');z=s.repl(z,']','');z=s.repl(z,\"'\",'');arry"
+"[q]=s.split(z,',')}}var e=new Date();e.setFullYear(e.getFullYear()+"
+"5);if(dv==0&&arry.length>0&&arry[arry.length-1][0]==v)arry[arry.len"
+"gth-1]=[v,new Date().getTime()];else arry[arry.length]=[v,new Date("
+").getTime()];var start=arry.length-ct<0?0:arry.length-ct;var td=new"
+" Date();for(var x=start;x<arry.length;x++){var diff=Math.round((td."
+"getTime()-arry[x][1])/86400000);if(diff<ex){h[g]=unescape(arry[x][0"
+"]);a[g]=[arry[x][0],arry[x][1]];g++;}}var data=s.join(a,{delim:',',"
+"front:'[',back:']',wrap:\"'\"});s.c_w(cn,data,e);var r=s.join(h,{deli"
+"m:dl});if(ce)s.c_w(cn,'');return r;");
/*
 * Plugin Utility: Replace v1.0
 */
s.repl=new Function("x","o","n",""
+"var i=x.indexOf(o),l=n.length;while(x&&i>=0){x=x.substring(0,i)+n+x."
+"substring(i+o.length);i=x.indexOf(o,i+l)}return x");

This plugin is not supposed to be used except with the support of your Omniture Implementation Consultant. However having said that, this is what I have:

/* Plug-in Example: crossVisitParticipation v1.7  
In the following sample call:  
A list of s.campaign values will be returned.  New s.campaign values will be appended to
the list.  The list will be stored in a cookie named "s_ev22".  Each s.campaign value will
be stored for 30 days and a maximum of 5 values will be stored in the campaigns list.  If
event2 is set the list will be cleared, and sequential duplicate values are allowed.

s.eVar22=s.crossVisitParticipation(s.campaign,'s_ev22','30','5','>','event2',1);
*/

Also note that you need to have the Replace plugin for it to work.

/*
 * Plug-in: crossVisitParticipation v1.7 - stacks values from
 * specified variable in cookie and returns value
 */

s.crossVisitParticipation=new Function("v","cn","ex","ct","dl","ev","dv",""
+"var s=this,ce;if(typeof(dv)==='undefined')dv=0;if(s.events&&ev){var"
+" ay=s.split(ev,',');var ea=s.split(s.events,',');for(var u=0;u<ay.l"
+"ength;u++){for(var x=0;x<ea.length;x++){if(ay[u]==ea[x]){ce=1;}}}}i"
+"f(!v||v==''){if(ce){s.c_w(cn,'');return'';}else return'';}v=escape("
+"v);var arry=new Array(),a=new Array(),c=s.c_r(cn),g=0,h=new Array()"
+";if(c&&c!=''){arry=s.split(c,'],[');for(q=0;q<arry.length;q++){z=ar"
+"ry[q];z=s.repl(z,'[','');z=s.repl(z,']','');z=s.repl(z,\"'\",'');arry"
+"[q]=s.split(z,',')}}var e=new Date();e.setFullYear(e.getFullYear()+"
+"5);if(dv==0&&arry.length>0&&arry[arry.length-1][0]==v)arry[arry.len"
+"gth-1]=[v,new Date().getTime()];else arry[arry.length]=[v,new Date("
+").getTime()];var start=arry.length-ct<0?0:arry.length-ct;var td=new"
+" Date();for(var x=start;x<arry.length;x++){var diff=Math.round((td."
+"getTime()-arry[x][1])/86400000);if(diff<ex){h[g]=unescape(arry[x][0"
+"]);a[g]=[arry[x][0],arry[x][1]];g++;}}var data=s.join(a,{delim:',',"
+"front:'[',back:']',wrap:\"'\"});s.c_w(cn,data,e);var r=s.join(h,{deli"
+"m:dl});if(ce)s.c_w(cn,'');return r;");
/*
 * Plugin Utility: Replace v1.0
 */
s.repl=new Function("x","o","n",""
+"var i=x.indexOf(o),l=n.length;while(x&&i>=0){x=x.substring(0,i)+n+x."
+"substring(i+o.length);i=x.indexOf(o,i+l)}return x");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文