JavaScript Conversion Tracking

  1. Please add this script to your HOMEPAGE FOOTER and any other entry page (ex: product pages, alternative landing pages).
    • If you’re using Google Tag Manager, you can have this script appear on all source codes pages.

<script>
!function(){
var e=window.flextrack=window.flextrack||[];
if(e.invoked)window.console&&console.error&&console.error("FlexOffers library was included more than once.");
else{e.invoked=!0,e.methods=["init","getClick","track"],e.factory=function(r){return function(){var t=Array.prototype.slice.call(arguments);
return t.unshift(r),e.push(t),e}};for(var r=0;r<e.methods.length;r++){var t=e.methods[r];e[t]=e.factory(t)}e.init=function(r)
{var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://advertiserpro.flexoffers.com/vendors/flexoffers/flexoffers.tracking.lib.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n),e.advertiserId=r}}}();
flextrack.init("ADVERTISER ID");
flextrack.getClick();
</script>

 
  1. Please add this script to your ORDER CONFIRMATION PAGE
  • Add account unique ID in the advertiserid parameter found inside your account.
    • Please email your account manager to request it if needed.
  • Add Sale Amount code in the orderamount parameter (only required for CPS programs)
  • Add Order ID code in the orderid parameter (required for all programs)

<script>
!function(){var e=window.flextrack=window.flextrack||[];if(e.invoked)window.console&&console.error&&console.error("FlexOffers library was included more than once.");else{e.invoked=!0,e.methods=["init","getClick","track"],e.factory=function(r){return function(){var t=Array.prototype.slice.call(arguments);return t.unshift(r),e.push(t),e}};for(var r=0;r<e.methods.length;r++){var t=e.methods[r];e[t]=e.factory(t)}e.init=function(r){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://advertiserpro.flexoffers.com/vendors/flexoffers/flexoffers.tracking.lib.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n),e.advertiserId=r}}}();
flextrack.init("ADVERTISER ID");

flextrack.track({
order_number: ,
order_amount: ,
order_coupon: ,

order_items: [
{ sku: {{product_sku}}, amount: {{item_amount}},commissionid:{{commission_id}}, quantity: {{item_quantity}}, order_coupon: {{order_coupon}} },
{ sku: {{product_sku}}, amount: {{item_amount}},commissionid:{{commission_id}}, quantity: {{item_quantity}}, order_coupon: {{order_coupon}} },
{ sku: {{product_sku}}, amount: {{item_amount}}, quantity: {{item_quantity}}, order_coupon: {{order_coupon}} }
],
});
</script>

  1. Once implemented, please email your account manager to request a test link.

Articles in this section