Articles on: Online store
This article is also available in:

Add tracking code to thank-you page

Tracking codes are code snippets attached to the website to record information of customers buying on the website. You can optimize your ad campaigns on different channels by inserting the tracking code on the store's thank you page. There are many ways to install a tracking code on your Thank-you page. For the tracking code provided by a third party, it will be used as Additional scripts in your ShopBase admin site. In this article, we will guide you on how to add tracking code to thank-you page in just a few steps!

In this article



A. How to add tracking code to your thank-you page
B. Types of tracking codes

A. How to add tracking code to your thank-you page



From your store admin, go to Online Store > Preferences.


Scroll to the Additional scripts > Head section.


Paste this script.

<script> 
window.sbsdk.ready(function() {
    window.sbsdk.page.onContextUpdate(function(context) {
        if (context.type === 'post_checkout') {
            // Inject code tracking here
        }
    });
});
</script>

Replace the tracking scripts (provided by a third-party) in // Inject code tracking here section.

Click Save and you are done!

B. Types of tracking codes



Facebook Pixel tracking code

You can set up Facebook Pixel to track when customers visit your checkout page and finish purchasing, please refer to this article for more details.

Google Ads conversion tracking coded

Other than Facebook Pixel, you can use Google Analytics conversion tracking for customers' checkout process. Please refer to this article on tracking Google Ads Conversion with ShopBase.

Twitter tracking code

Kindly follow this article to know how to install Twitter conversion tracking ID on ShopBase.



Overview of Preferences
Add custom announcement to product page

Updated on: 14/09/2022

Was this article helpful?

Share your feedback

Cancel

Thank you!