2011-05-06 5 views
0

나는 내가 여기omniture에서 s.crossVisitParticipation을 사용하는 방법?

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;"); 

버전 1.7를 사용하여 내 호출 코드하고, 어디서든이 기능에 대한 문서화를 찾을 수 없습니다.

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

아무 것도 반환하지 않고 계속 도움을 주시면 감사하겠습니다. 감사합니다

+1

신경 끄시이 기능을 해독했고,이 디버깅없는 플러그인, 낭비 시간이 있습니다 발견 ... –

+0

일부 문서가 여기에있다 : http://digitalanalytic.blogspot.co.uk/2012/06/ 교차 방문 참여 - plugin.html – duncan

+0

... 여기에 "_REQUIRES : split, join plugin"_ – duncan

답변

1

이 플러그인은 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"); 
관련 문제