Advertisement
paulshoptalk

Untitled

Apr 24th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!-- START of Rakuten Marketing Conversion Tag -->
  2. <script type="text/javascript">
  3. var rm_trans = {
  4.     displayConfig: {rdMID: "7584"},
  5.  
  6.     orderid : */referencenumber/*,
  7.     currency: 'USD',
  8.     customerStatus: 'CONFIRMED',
  9.     conversionType: 'Sale',
  10.     customerID: '*/referencenumber/*',
  11.     discountCode: '',
  12.     discountAmount: 0,
  13.     taxAmount: 0,
  14.     optionalData: {},
  15.     lineitems : [{
  16.         quantity : 1,
  17.         unitPrice : */regcost/*,
  18.         unitPriceLessTax: */regcost/*,
  19.         SKU: '*/referencenumber/*',
  20.         productName: '*/category/*',
  21.         optionalData: {
  22.             brand: '',
  23.             cat: '',
  24.             coupon: '',
  25.             discount: ''      
  26.         }
  27.     }]
  28. };
  29. /*Do not edit any information beneath this line*/
  30. window.DataLayer?(DataLayer.events=DataLayer.events||{},DataLayer.Sale=DataLayer.Sale||{Basket:rm_trans},DataLayer.Sale.Basket=DataLayer.Sale.Basket||rm_trans):window.DataLayer={Sale:{Basket:rm_trans},events:{}},DataLayer.events.SPIVersion="3.3",DataLayer.Sale.Basket.Ready=!0;function __readRMCookie(e){for(var t=e+"=",a=document.cookie.split(";"),r=0;r<a.length;r++){for(var o=a[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}function __readRMCookiev2(e,t){for(var a=__readRMCookie(t=t||"rmStore");a!==decodeURIComponent(a);)a=decodeURIComponent(a);for(var r=a.split("|"),o=0;o<r.length;o++){var n=r[o].split(":")[0],i=r[o].split(":")[1];if(n===e)return i}return""}function __readParam(e,t,a,r){var o=t||"",n=a||"",i=r||{},s=__readRMCookiev2(e||""),d=i[o],u=(s=i.ignoreCookie||!1?0:s)||d||n;return u=("string"!=typeof u||"false"!==u.toLowerCase())&&u}function sRAN(){var e=DataLayer&&DataLayer.Sale&&DataLayer.Sale.Basket?DataLayer.Sale.Basket:{},t=e.affiliateConfig||{},a=__readParam("atm","tagType","pixel",t),r=__readParam("adr","discountType","order",t),o=__readParam("acs","includeStatus","false",t),n=__readParam("arto","removeOrderTax","false",t),i=__readParam("artp","removeTaxFromProducts","false",t),s=__readParam("artd","removeTaxFromDiscount","false",t),d=__readParam("atr","taxRate",0,t),u=(100+(d=Number(d)))/100,m=__readParam("ald","land",!1,{})||(t.land&&!0===t.land?__readRMCookie("ranLandDateTime"):t.land)||!1,c=__readParam("atrv","tr",!1,{})||(t.tr&&!0===t.tr?__readRMCookie("ranSiteID"):t.tr)||!1,l=!1,p=__readParam("amid","ranMID","",t)||e.ranMID;if(!p)return!1;if(!(void 0===t.allowCommission||"false"!==t.allowCommission))return!1;var y=encodeURIComponent(e.orderid||"OrderNumberNotAvailable"),v="",N="",f="",C="",_=e.currency||"";_=encodeURIComponent(_.toUpperCase());var h=e.taxAmount?Math.abs(Math.round(100*Number(e.taxAmount))):0,I=e.discountAmount?Math.abs(Math.round(100*Number(e.discountAmount))):0;s&&d&&(I=Math.round(I/u));var g="pixel"===a?"ep":"mop"===a?"eventnvppixel":"ep",D=(e.customerStatus||"")+"",R=document.location.protocol+"//track.linksynergy.com/"+g+"?",b="";D&&(o&&"EXISTING"==D.toUpperCase()||o&&"RETURNING"==D.toUpperCase())&&(b="R_");for(var L=[],U=0,S=0;S<(e.lineitems?e.lineitems.length:0);S++){var T=!1,w=window.JSON?JSON.parse(JSON.stringify(e.lineitems[S])):e.lineitems[S],P=Number(w.unitPriceLessTax||w.unitPrice||0);i&&d&&!w.unitPriceLessTax&&(P/=u);for(var x=0;x<L.length;x++){L[x].SKU===w.SKU&&(T=!0,L[x].quantity=Number(L[x].quantity)+Number(w.quantity),L[x].totalValueLessTax=Number(L[x].totalValueLessTax)+Number(w.quantity)*P,L[x].totalValue=Number(L[x].totalValue)+Number(w.quantity)*Number(w.unitPrice))}T||(w.totalValue=Number(w.quantity)*Number(w.unitPrice),w.totalValueLessTax=Number(w.quantity)*P,L.push(w)),U+=Number(w.quantity)*P*100}var A={};for(S=0;S<L.length;S++){w=L[S];var k=encodeURIComponent(w.SKU),O=w.totalValueLessTax||w.totalValue,M=w.quantity,E=encodeURIComponent(w.productName)||"",q=100*Number(O);"item"===r.toLowerCase()&&I&&(q-=I*q/U);var B=w.optionalData;for(var V in B)B.hasOwnProperty(V)&&(A[V]=A[V]||"",A[V]+=encodeURIComponent(B[V])+"|");v+=b+k+"|",N+=M+"|",f+=Math.round(q)+"|",C+=b+E+"|"}v=v.slice(0,-1),N=N.slice(0,-1),f=f.slice(0,-1),C=C.slice(0,-1),I&&"order"===r.toLowerCase()?(v+="|"+b+"DISCOUNT",C+="|"+b+"DISCOUNT",N+="|0",f+="|-"+I):I&&"item"===r.toLowerCase()&&(l=!0),n&&h&&(v+="|"+b+"ORDERTAX",N+="|0",f+="|-"+h,C+="|"+b+"ORDERTAX"),R+="mid="+p+"&ord="+y+"&skulist="+v+"&qlist="+N+"&amtlist="+f+"&cur="+_+"&namelist="+C+"&img=1&",m&&(R+="land="+m+"&"),c&&(R+="tr="+c+"&"),l&&(R+="discount="+I+"&");B=e.optionalData||{};e.discountCode&&(B.coupon=e.discountCode),e.customerStatus&&(B.custstatus=e.customerStatus),e.customerID&&(B.custid=e.customerID),I&&(B.disamt=I);for(var V in B)B.hasOwnProperty(V)&&(R+=encodeURIComponent(V)+"="+encodeURIComponent(B[V])+"&");for(var V in A)A.hasOwnProperty(V)&&(R+=encodeURIComponent(V)+"list="+A[V].slice(0,-1),I&&"order"===r.toLowerCase()&&(R+="disamt"==V||"margin"==V?"|0":"|DISCOUNT"),h&&n&&(R+="disamt"==V||"margin"==V?"|0":"|ORDERTAX"),R+="&");"&"===R[R.length-1]&&(R=R.slice(0,-1)),R.length>2037&&(R=R.slice(0,2037),R+="&trunc=true");var j,K=document.createElement("img");K.setAttribute("src",R),K.setAttribute("height","1px"),K.setAttribute("width","1px"),(j=document.getElementsByTagName("script")[0]).parentNode.insertBefore(K,j)}function sDisplay(){var e=null,t=e,a=e,r=e,o=e,n=window.DataLayer&&window.DataLayer.Sale&&window.DataLayer.Sale.Basket?window.DataLayer.Sale.Basket:{},i=n.displayConfig||{},s=(n.customerStatus||"")+"",d=n.discountAmount?Math.abs(Number(n.discountAmount)):0,u=e,m="",c=__readParam("dmid","rdMID","",i);if(!c)return!1;var l=__readParam("dtm","tagType","js",i),p="if"===(l="js"===l||"if"===l||"img"===l?l:"js")?"iframe":"img"===l?l:"script",y="//"+__readParam("ddn","domain","tags.rd.linksynergy.com",i)+"/"+l+"/"+c,v=__readParam("dis","includeStatus","false",i),N=__readParam("dcomm","allowCommission","notset",i);"true"===N||!0===N||"1"===N||1===N?m="1":"false"!==N&&!1!==N&&"0"!==N&&0!==N||(m="0");var f="";if(s&&(v&&"EXISTING"==s.toUpperCase()||v&&"RETURNING"==s.toUpperCase())&&(f="R_"),!n.orderid||!n.conversionType)return!1;r=0,a=encodeURIComponent(f+n.orderid),t="",o="conv",u=encodeURIComponent(n.currency||"");for(var C=0;C<(n.lineitems?n.lineitems.length:0);C++)r+=Number(n.lineitems[C].unitPriceLessTax)*Number(n.lineitems[C].quantity)||Number(n.lineitems[C].unitPrice)*Number(n.lineitems[C].quantity),t+=encodeURIComponent(n.lineitems[C].SKU)+",";r=Math.round(100*(r-d))/100,t=t.slice(0,-1),o&&(y=y.indexOf("?")>-1?y+"&pt="+o:y+"/?pt="+o),t&&(y=y.indexOf("?")>-1?y+"&prodID="+t:y+"/?prodID="+t),a&&(y=y.indexOf("?")>-1?y+"&orderNumber="+a:y+"/?orderNumber="+a),r&&(y=y.indexOf("?")>-1?y+"&price="+r:y+"/?price="+r),u&&(y=y.indexOf("?")>-1?y+"&cur="+u:y+"/?cur="+u),m&&(y=y.indexOf("?")>-1?y+"&tvalid="+m:y+"/?tvalid="+m);var _=document.createElement(p);_.src=y,"script"===p?_.type="text/javascript":"iframe"===p&&_.setAttribute("style","display: none;"),document.getElementsByTagName("body")[0].appendChild(_)}function sSearch(){var e=window.DataLayer&&window.DataLayer.Sale&&window.DataLayer.Sale.Basket?window.DataLayer.Sale.Basket:{},t=e.searchConfig||{},a=encodeURIComponent("...TRUNCATED"),r=__readParam("smid","rsMID","",t);if(!r)return!1;var o=__readParam("said","accountID","113",t),n=function(){var n={};if(n.conversionType=encodeURIComponent(__readParam("sct","conversionType",e.conversionType&&"sale"!==(e.conversionType+"").toLowerCase()?e.conversionType:"conv",t)),n.revenue=0,n.currency=encodeURIComponent(e.currency||"USD"),n.orderId=encodeURIComponent(e.orderid||""),n.promoCode=encodeURIComponent(e.discountCode||""),n.discountAmount=e.discountAmount?Math.abs(Number(e.discountAmount)):0,n.customerStatus=encodeURIComponent(e.customerStatus||""),n.productIDList="",n.productNameList="",e.lineitems&&e.lineitems.length){for(var i=0;i<e.lineitems.length;i++)n.revenue+=Number(e.lineitems[i].unitPrice||0)*Number(e.lineitems[i].quantity),n.productIDList+=(e.lineitems[i].SKU||"NA")+",",n.productNameList+=(e.lineitems[i].productName||"NA")+",";n.revenue=Math.round(100*(n.revenue-n.discountAmount))/100,n.productIDList=encodeURIComponent(n.productIDList.slice(0,-1)),n.productNameList=encodeURIComponent(n.productNameList.slice(0,-1)),n.productIDList.length>1024&&(n.productIDList=n.productIDList.substring(0,1024-a.length)+a),n.productNameList.length>1024&&(n.productNameList=n.productNameList.substring(0,1024-a.length)+a)}kenshoo.trackConversion(o,r,n)},i=document.location.protocol.indexOf("s")>-1?"https://":"http://";i+="services.xg4ken.com/js/kenshoo.js?cid="+r;var s=document.createElement("script");s.type="text/javascript",s.src=i,s.onload=n,s.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||n()},document.getElementsByTagName("head")[0].appendChild(s)}sRAN(),sDisplay(),sSearch();
  31. </script>
  32. <!-- END of Rakuten Marketing Conversion Tag -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement