Order Tracking
Step 1. Adding the Order Tracking Code
- This step tracks the transaction_id appended to the link when redirecting to the merchant website.
- The merchant is free to add specific triggers such as “utm_source=shopback”.
- Please add the following code snippet into ALL page(s) that users first land on in order to support tracking on all landing pages.
- Take note not to add this snippet to the checkout page.
<script>
!function(){var o=window.tdl=window.tdl||[];if(o.invoked)window.console&&console.error&&console.error("Tune snippet has been included more than once.");else{o.invoked=!0,o.methods=["init","identify","convert"],o.factory=function(n){return function(){var e=Array.prototype.slice.call(arguments);return e.unshift(n),o.push(e),o}};for(var e=0;e<o.methods.length;e++){var n=o.methods[e];o[n]=o.factory(n)}o.init=function(e){var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://js.go2sdk.com/v2/tune.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(n,t),o.domain=e}}}();
tdl.init("https://shopback.go2cloud.org");
tdl.identify();
</script>
Step 2: Adding the Conversion Code - Order Tracking
- This snippet is used to convert user purchases and send the purchase information to ShopBack.
- The snippet below is for Order Tracking only.
- For Line Item Tracking, please follow this section instead.
- Please add the following code snippet below to the checkout page only
<script>
!function(){var o=window.tdl=window.tdl||[];if(o.invoked)window.console&&console.error&&console.error("Tune snippet has been included more than once.");else{o.invoked=!0,o.methods=["init","identify","convert"],o.factory=function(n){return function(){var e=Array.prototype.slice.call(arguments);return e.unshift(n),o.push(e),o}};for(var e=0;e<o.methods.length;e++){var n=o.methods[e];o[n]=o.factory(n)}o.init=function(e){var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://js.go2sdk.com/v2/tune.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(n,t),o.domain=e}}}();
tdl.init("https://shopback.go2cloud.org");
tdl.convert({
'adv_sub': '{{ customer_facing_order_id }}',
'adv_sub2': '{{ optional_sub2 }}',
'adv_sub3': '{{ optional_sub3 }}',
'adv_sub4': '{{ optional_sub4 }}',
'adv_sub5': '{{ optional_sub5 }}',
'adv_unique1': '{{ optional_sub6 }}',
'adv_unique2': '{{ optional_sub7 }}',
'adv_unique3': '{{ optional_sub8 }}',
'adv_unique4': '{{ optional_sub9 }}',
'adv_unique5': '{{ optional_sub10 }}',
'amount': '{{ order_total }}',
})
</script>
Additional changes to Conversion Code required to add in conversion values or macros
Example Conversion Code
<script>
!function(){var o=window.tdl=window.tdl||[];if(o.invoked)window.console&&console.error&&console.error("Tune snippet has been included more than once.");else{o.invoked=!0,o.methods=["init","identify","convert"],o.factory=function(n){return function(){var e=Array.prototype.slice.call(arguments);return e.unshift(n),o.push(e),o}};for(var e=0;e<o.methods.length;e++){var n=o.methods[e];o[n]=o.factory(n)}o.init=function(e){var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://js.go2sdk.com/v2/tune.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(n,t),o.domain=e}}}();
tdl.init("https://shopback.go2cloud.org");
tdl.convert({
'adv_sub': 'MY1001',
'adv_sub2': 'New Customer',
'amount': '1234.56',
})
</script>
Conversion Parameters Reference - Order Tracking
ShopBack currently supports tracking 10 different conversion parameters with 1 of them reserved for customer-facing order id
. Please see the below explanation:
Parameter Name | Parameter Value | Example Value | Description | Format | Required? |
---|---|---|---|---|---|
adv_sub | { customer_facing_order_id } | MY1001 | Customer-facing order id | alphanumeric | mandatory |
adv_sub2 | alphanumeric | optional | |||
adv_sub3 | alphanumeric | optional | |||
adv_sub4 | alphanumeric | optional | |||
adv_sub5 | alphanumeric | optional | |||
adv_unique1 | alphanumeric | optional | |||
adv_unique2 | alphanumeric | optional | |||
adv_unique3 | alphanumeric | optional | |||
adv_unique4 | alphanumeric | optional | |||
adv_unique5 | alphanumeric | optional | |||
amount | { order_total } | 1234.56 | Total order amount. The commission amount will be calculated based on this amount. | - numeric value (2 decimals max) - will not accept “,” (commas) - will not accept “MYR” (currency code) | mandatory |
Please notify your ShopBack representative to begin testing after both Step 1 and 2 are completed
Updated over 1 year ago