InterviewSolution
Saved Bookmarks
| 1. |
Solve : Can someone please help explain this javascript function in your own words?? |
|
Answer» http://jsbin.com/ruzurorokofu/1/edit If anyone could be a great help and help me understand what this javascript function is trying to accomplish? Any brief explanation would be great Code: [Select]/* Engagement Score */ s.eVar5=s.engagementScore('event31','s.pageName|products|1>s.events|event6|1>s.eVar3|competitiveMatrix.pdf|1>s.pageName|webLeadsForm:complete|1>s.events|purchase|1>s.events|event4|1>s.events|scView|1'); /* Engagement Score Tracking */ s.engagementScore = new Function("e","l","c",""); var A,B,C,D,E,F,G,H,I,J; I=J=''; A=s.split(l,'>'); B=A.length; E=c?c:'s_ES'; //D=value of cookie with name 'E' D=s.c_r(E); if(!D){ for(C=0;C<B;C++){ D=D+'0,'; } } D=s.split(D,','); for(C=0;C<B;C++){ F=s.split(A[C],'|'); G=eval(F[0]); if(D[C]==1){ I=I+'1,'; } else if(G!=undefined){ if(G.indexOf(F[1])>-1&&D[C]!=1){ s.events=s.apl(s.events,e,',',2); s.products=s.apl(s.products,';;;;'+e+'='+F[2],',',2); I=I+'1,'; J='+'+F[2]; } else { I=I+'0,'; } } else{ I=I+'0,'; } } s.c_w(E,I,0); return J; s.split=new Function("l","d",""+"var i,x=0,a=new Array;while(l){i=l.indexOf(d);i=i>-1?i:l.length;a[x"+"++]=l.substring(0,i);l=l.substring(i+d.length);}return a");We are going to need more CONTEXT about what you are trying to do but to me that file looks like it's for Adobe Analytics/Sitecatalyst/Omniture based on the name of some of the variables used.camerongray, It is for SiteCatalyst , which is supposed to track engagement score. Seeing the different variables: pageName|Products, eVar3(matrix.pdf), webleads form COMPLETION page and purchase. What is the newFunction constructor doing with the variables? Is it adding a score value? or is it just seeing if you made a purchase, see if you also engaged with the form completion page, .pdf, or other products? I just need to verify if I am sort of reading this correctly. Not needing a solution, but more what the function is doing to get the engagementScore.Here is some info on the score weights etc: http://blogs.adobe.com/digitalmarketing/analytics/summit-topic-1-visitor-scoring-in-sitecatalyst/ |
|