- Conversion tracking
- Commission based on order amount
- Supports lifetime commissions
- Track order currency
- Track affiliate coupon code conversions
- Auto-handle recurring commissions
- Auto-handle refunds and disputes
Note: This integration only works for WIX online stores. Any other WIX use case is not supported.
Important to know: WIX Stores recently rolled out a Corvid update that may not be available to all WIX Stores users at this time. Below you will find two distinct methods of installing our code in your WIX store. Please choose the one that applies to your specific WIX Stores set up.
Old method: Adding code to Site tab
In your WIX editor, click “Dev Mode”. If you haven’t already, click “Enable Corvid”.
In the “Site Structure” panel on the left of your page, under Pages > Shop, click “Thank You Page”.
Click on the sample order details in the middle of the editor. This will open the properties panel. If the value after
ID
is notthankYouPage1
, copy the actual value and replace “thankYouPage1” at the top of the code snippet below.At the bottom of the page, click the bar that says “Site code”. On the left side of that panel that popped up, click on the Site tab.
Erase the code that’s in the Site tab, and paste the following code in:
const thankYouPageId = "((((thankYouPage1))))"; // Replace with your thank you page id if not thankYouPage1 const accountId = "((((YOUR ACCOUNT ID))))"; import wixLocation from"wix-location";import wixWindow from"wix-window" ;import{fetch}from"wix-fetch";import{local}from"wix-storage";let query=wixLocation.query;const removeUndefined=e=>{for(var t in e){ if(e[t]===undefined)delete e[t]}return e};const objectToQueryString=e=>{var t,o,n,r,i,c;o=[];i=/%20/g;n=function(e,t){ t=typeof t==="function"?t():t===null?"":t;o[o.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(e instanceof Array){for(r in e){n(r,e[r])} }else{for(t in e){buildParams(t,e[t],n)}}c=o.join("&").replace(i,"+");return c};function buildParams(e,t,o){var n,r,i,c;c=/\[\]$/ ;if(t instanceof Array){for(r=0,i=t.length;r<i;r++){if(c.test(e)){o(e,t[r])}else{buildParams(e+"["+(typeof t[r]==="object"?r:"")+"]",t[r],o)}} }else if(typeof t==="object"){for(n in t){buildParams(e+"["+n+"]",t[n],o)}}else{o(e,t)}}const getPublisherMeta=()=>{let e=null;for(var t in query){ if(t.slice(0,3)==="tm_"){e=e||{};e[t.slice(3,t.length)]=query[t]}}return e};const request=(e,t,o,n)=>{t=removeUndefined(t);t.sv="wix-v1" ;const r=objectToQueryString(t);const i=e+"?"+r;o=o||i.length>2083?"POST":"GET";const c=o==="GET"?i:e;t=o==="POST"?JSON.stringify(t):null;const a={ method:o,body:t};if(t){a.body=t}fetch(c,a).then(e=>{if(!e.ok)return null;return e.json()}).then(e=>{if(e&&typeof n==="function"){n(e)}})} ;if(query.ref||(query.tap_a&&query.tap_s)){const e={acc:accountId,refc:query.ref,aid:query.tap_a,sid:query.tap_s,pm:getPublisherMeta(),ref:wixWindow.referrer,cup:wixLocation.url, int:"wix"};request("https://frstre.com/event/",e,null,e=>{local.setItem("tap_vid",e.vid)})}$w.onReady(function(){const e=$w("#"+thankYouPageId) ;if(Array.isArray(e))return;e.getOrder().then(e=>{const t=local.getItem("tap_vid");if(!t)return;const o={customer_id:e.billingInfo.email, currency:e.currency};if(e.appliedCoupon){o.coupons=e.appliedCoupon.code}const n=e.totals.subtotal-e.totals.discount;const r={acc:accountId,vid:[t], tid:e.number,tam:n,options:o,int:"wix"};request("https://tapi.livaffiliate.com/conversions/",r,"POST")}).catch(()=>{})});
{{{{NO_ACCOUNT_ID_SET_MESSAGE}}}}
Hit “Publish” and you’re done.
New method: Adding code to masterPage.js
In your WIX editor, click “Dev Mode” at the tope, and turn on Dev mode.
In the “Site Structure” panel on the left of your page, under Pages > Shop, click “Thank You Page”. Here, click on the sample order details in the middle of the editor. This will open the properties panel and show you the section’s
ID
. If the value afterID
is notthankYouPage1
, copy the actual value and replace “thankYouPage1” at the top of the code snippet you see in Step 4.Once you have confirmed the
ID
of your Thank You page, find masterPage.js and click to open it.In the
masterPage.js
tab that opens at the bottom of the page, erase all of the existing code and paste the following code:const thankYouPageId = "((((thankYouPage1))))"; // Replace with your thank you page id if not thankYouPage1 const accountId = "((((YOUR ACCOUNT ID))))"; import wixLocation from"wix-location";import wixWindow from"wix-window" ;import{fetch}from"wix-fetch";import{local}from"wix-storage";let query=wixLocation.query;const removeUndefined=e=>{for(var t in e){ if(e[t]===undefined)delete e[t]}return e};const objectToQueryString=e=>{var t,o,n,r,i,c;o=[];i=/%20/g;n=function(e,t){ t=typeof t==="function"?t():t===null?"":t;o[o.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(e instanceof Array){for(r in e){n(r,e[r])} }else{for(t in e){buildParams(t,e[t],n)}}c=o.join("&").replace(i,"+");return c};function buildParams(e,t,o){var n,r,i,c;c=/\[\]$/ ;if(t instanceof Array){for(r=0,i=t.length;r<i;r++){if(c.test(e)){o(e,t[r])}else{buildParams(e+"["+(typeof t[r]==="object"?r:"")+"]",t[r],o)}} }else if(typeof t==="object"){for(n in t){buildParams(e+"["+n+"]",t[n],o)}}else{o(e,t)}}const getPublisherMeta=()=>{let e=null;for(var t in query){ if(t.slice(0,3)==="tm_"){e=e||{};e[t.slice(3,t.length)]=query[t]}}return e};const request=(e,t,o,n)=>{t=removeUndefined(t);t.sv="wix-v1" ;const r=objectToQueryString(t);const i=e+"?"+r;o=o||i.length>2083?"POST":"GET";const c=o==="GET"?i:e;t=o==="POST"?JSON.stringify(t):null;const a={ method:o,body:t};if(t){a.body=t}fetch(c,a).then(e=>{if(!e.ok)return null;return e.json()}).then(e=>{if(e&&typeof n==="function"){n(e)}})} ;if(query.ref||(query.tap_a&&query.tap_s)){const e={acc:accountId,refc:query.ref,aid:query.tap_a,sid:query.tap_s,pm:getPublisherMeta(),ref:wixWindow.referrer,cup:wixLocation.url, int:"wix"};request("https://frstre.com/event/",e,null,e=>{local.setItem("tap_vid",e.vid)})}$w.onReady(function(){const e=$w("#"+thankYouPageId) ;if(Array.isArray(e))return;e.getOrder().then(e=>{const t=local.getItem("tap_vid");if(!t)return;const o={customer_id:e.billingInfo.email, currency:e.currency};if(e.appliedCoupon){o.coupons=e.appliedCoupon.code}const n=e.totals.subtotal-e.totals.discount;const r={acc:accountId,vid:[t], tid:e.number,tam:n,options:o,int:"wix"};request("https://tapi.livaffiliate.com/conversions/",r,"POST")}).catch(()=>{})});
{{{{NO_ACCOUNT_ID_SET_MESSAGE}}}}
Hit “Publish” and you’re done.
Important
Please remember to test a conversion before starting your program. This way you can verify that tracking has been set up correctly. You can create a test conversion by following the steps described here.