Transmitting basket data via Webhooks
Transmitting basket data via browser side Webhooks
Before you start
If you implement your own Webhook in the UI you will find you can use various placeholders to transmit conversion related data from the platform to your own system. However, a placeholder related to basket data is not among them. This is because basket data consists of several data elements, which cannot be transmitted via one placeholder. If you follow the instructions below however, you can make sure basket data is transmitted all the same. Please note the solution with javascript is highly recommended, only use the solution with the image code if you do not have another option.
Transmitting basket data via javascript
Suppose the javascript you have implemented is the following:
<script type="text/javascript">
document.write('<img src="http://yourcode.tracking.org/aff_l?channel_id=234&adv_sub=#{CONVERSION_ID}&amount=#{ORDER_VALUE}" width="1" height="1" border="0" />');
</script>
To make sure the code transmits basket data, you need to start by adding a a parameter, for example pid=
. This parameter needs to be filled with a placeholder called #{BASKET_VALUE_trc}
. When you have added this placeholder, your code will look more or less like this:
<script type="text/javascript">
document.write('<img src="http://yourcode.tracking.org/aff_l?channel_id=234&adv_sub=#{CONVERSION_ID}&amount=#{ORDER_VALUE}&pid=#{BASKET_VALUE_trc}" width="1" height="1" border="0" />');
</script>
To make sure the basket data is transmitted in one string, you need to add to more placeholders: #{BASKET_ARRAY_BEGIN}
at the beginning and #{BASKET_ARRAY_END}
at the end of the code. When you have added these placeholders, your code will look more or less like this:
#{BASKET_ARRAY_BEGIN}<script type="text/javascript">
document.write('<img src="http://yourcode.tracking.org/aff_l?channel_id=234&adv_sub=#{CONVERSION_ID}&amount=#{ORDER_VALUE}&pid=#{BASKET_VALUE_trc}" width="1" height="1" border="0" />');
</script>#{BASKET_ARRAY_END}
As soon as you have created this code, all you need to do is implement it following the instructions in the article on the Webhooks feature.
Transmitting basket data via an image code
Suppose the image pixel you have implemented is the following:
yourcode.tracking.org/aff_l?channel_id=234&adv_sub=#{CONVERSION_ID}&amount=#{ORDER_VALUE}
When you want to transmit basket data, you first need to create a parameter, for example pid=
. This parameter needs to be filled with a placeholder called #{BASKET_VALUE_trc}
. When you have added this placeholder, your code will look more or less like this:
yourcode.tracking.org/aff_l?channel_id=234&adv_sub=#{CONVERSION_ID}&amount=#{ORDER_VALUE}&pid=#{BASKET_VALUE_trc}
To make sure the basket data is transmitted in one string, you need to add to more placeholders: #{BASKET_ARRAY_BEGIN}
at the beginning and #{BASKET_ARRAY_END}
at the end of the code. When you have added these placeholders, your code will look more or less like this:
#{BASKET_ARRAY_BEGIN}yourcode.tracking.org/aff_l?channel_id=234&adv_sub=#{CONVERSION_ID}&amount=#{ORDER_VALUE}&pid=#{BASKET_VALUE_trc}#{BASKET_ARRAY_END}
As soon as you have created this code, all you need to do is implement it following the instructions in the article on the Webhooks feature.