Integrating with Javascript (all other)

  1. This is your tracking code. Place the code in the head of every page of your website - between the <head> and </head> HTML tags.

<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
<script type="text/javascript">
  (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');
  
  tap('create', '((((YOUR ACCOUNT ID))))');
  tap('detect');
</script>

{{{{NO_ACCOUNT_ID_SET_MESSAGE}}}}

  1. Whenever a conversion takes place, you will need to signal our platform that this happened. To do so, you can use our conversion page code. This code is usually placed on your thank you page, right after the order has been completed, or the lead data has been collected. There are several levels of integration possible with this code. By far the easiest is by using the following snippet:

<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
<script type="text/javascript">
  (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

  tap('create', '((((YOUR ACCOUNT ID))))');
  tap('conversion');
</script>

{{{{NO_ACCOUNT_ID_SET_MESSAGE}}}}

Important: This concludes our setup instructions for our most basic form of integration. With this way of integration you won’t be able to to cross-reference conversions or to use percentage based commissions. If you want to make use of these features, please read on below.

Optional: Cross-referencing and deduplication

We strongly advise you to send along a unique conversion id when tracking a conversion. This id can be anything that is meaningful to you, like an order id, user id, lead email address etc.. If you send a conversion id along in our tracking code, you will then be able to see this id alongside the conversion data on our platform. This will allow you to cross-reference data on our platform with your own administration. Next to that, we perform automatic deduplication for you based on the id.

To send along a conversion id, please add it as the second argument to the ‘conversion’ method in our conversion page code:

<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
<script type="text/javascript">
  (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

  tap('create', '((((YOUR ACCOUNT ID))))');
  tap('conversion', '((((Unique Conversion Id))))');
</script>

{{{{NO_ACCOUNT_ID_SET_MESSAGE}}}}

  • [[[[Unique Conversion Id]]]] is a unique id that should be generated on your end - you need to replace this placeholder text by an actual tag or variable that will automatically inject the respective value on each conversion. It can be anything that is meaningful to you, and unique for each transaction: an order number, user id, email address, etc. After a conversion has taken place, you can find this id alongside the conversion on our platform. This makes it very easy to cross-reference data on our platform with your own administration.

Optional: Percentage-based commissions

If you would like to use percentage based commissions, i.e. to have the commission be a percentage of e.g. the order amount, you will need to send along this amount in the conversion code like so:

<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
<script type="text/javascript">
  (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

  tap('create', '((((YOUR ACCOUNT ID))))');
  tap('conversion', '((((Unique Conversion Id))))', ((((Conversion Amount)))));
</script>

{{{{NO_ACCOUNT_ID_SET_MESSAGE}}}}

  • [[[[Unique Conversion Id]]]] see above.
  • [[[[Conversion Amount]]]] is the total value of the conversion. We use this value to calculate any percentage-based commissions you might have set up for your program. Be aware you also need to replace the placeholder text in the code by the actual tag or variable that passes this data on your website, dinamically injecting a new value on each transaction.

Advanced tracking

For all additional tracking posibilities, like conversion meta-data, commission types, callbacks, program groups and more… please check our complete tapfiliate.js reference.

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.

Start a 14-day free trial with all our features enabled

Start now