To integrate Audenticity with custom stores, you will need to add two different codes: one for tracking referred visitors and for tracking purchases made by those referred visitors.
Copy this code
<script defer type="text/javascript" src="https://app.audenticity.com/external/tracking/v1/custom.js?audenticity_code=AUD-########">
</script>Paste the above code inside the header tag so that it appears on every page of your website.
Replace the ###### with your Unique Tracking ID. Your Unique Tracking ID can be found under Settings.
By adding this code you are now tracking referred visitors to your site.
The below code should be placed in the HTML body of your Order Confirmation or Thank You page. This is the page directly following a valid sale and/or lead on your site.
Your website will need to send some unique values from the completed sale or lead into the Audenticity tracking code. The unique values that need to be sent are:
<script>
var aud_order_id = #orderId;
var aud_order_price = #orderGrandTotal;
var aud_order_subtotal = #orderSubtotal;
var aud_customer_email = #customerEmailAddress;
var aud_promo_code = #promoCode;
var aud_script_url = "https://app.audenticity.com/external/tracking/v1/custom_thank_you.js?audenticity_code=AUD-########&order_id="+ encodeURIComponent( aud_order_id ) + "&total_price="+ aud_order_price + "&subtotal_price="+ aud_order_subtotal +"&email=" + aud_customer_email + "&promo_code=" + aud_promo_code;
var aud_script = document.createElement("script");
aud_script.type = "text/javascript";
aud_script.src = aud_script_url;
aud_script.defer = true;
document.getElementsByTagName("head")[0].appendChild(aud_script);
</script>
Copy the above code
Paste the above code into the Order Confirmation page and dynamically replace #orderId, #orderGrandTotal, #orderSubtotal, #customerEmailAddress and #promoCode with the correct values for each order.
Ideally, the Order Confirmation page would only load once, right after the order is placed, and not every time the customer clicks on their order confirmation email or checks for tracking status. If the page does get reloaded in those instances, please give us a heads up.
Replace the ###### with your Unique Tracking ID. Your Unique Tracking ID can be found under Settings.