1. Home
  2. Custom Scripts & Codes
  3. Adding scripts to your checkout pages

Adding scripts to your checkout pages

Take your data tracking and customization to the next level with ThriveCart Custom Scripts. Add Tracking Code to Checkout pages in seconds and seamlessly Embed JavaScript or CSS to integrate analytics, set custom tracking pixels, or add custom styling.

Whether you’re setting up an advanced analytics integration or setting custom design tweaks with your own checkout page script configuration, ThriveCart gives you the flexibility to create a truly optimized checkout experience tailored to your business goals.

You have several options on where and how your scripts are embedded

  • Embed on every page in your funnel
  • Embed on your initial checkout page only
  • Embed on your upsell/downsell pages (set in the upsell/downsell products themselves)
  • Embed if specific products in the funnel are purchased*

How to add custom tracking script

Under your product settings, you’ll want to head over to the Checkout tab and then choose the Tracking tab.

If you’ve not already enabled it, you’ll want to enable the option “Do you want to add tracking code to your checkout pages” to enable checkout page script configuration.

This will then show you the following fields:

Field 1 – All pages

Any codes added to this box will be automatically added to all your checkout pages.* This would be the box to embed things like base tracking pixels or codes you want to trigger on every page in your funnel.

Field 2 – Checkout page only

Any codes added to this box will only be embedded on the initial checkout page. This is helpful if you want to fire certain triggers when a customer lands on your checkout page or if you want to add a social proof type service, chat modal or the such.

Field 3 – If the main product is purchased

Any codes added to this field will only be embedded on the ThriveCart hosted success page. This is helpful if you want to fire purchase events with your custom tracking pixel or scripts, or want something to trigger only when the main product is bought.

Field 4 – If the bump product is purchased

This box only shows if you have a valid bump offer on your product. Any codes added to this field will only be embedded on the ThriveCart hosted success page. This is helpful if you want to fire purchase events in your tracking scripts or want something to trigger only when the bump product is bought.

Your upsell products have similar options. Note that base tracking pixels do not need to be added to your upsell page’s code area as this would typically be added to field 1 above. Embedded codes will still continue to work even when using custom upsell pages.

Quick note:

If you’re adding scripts to load when specific products are purchased, we’ll load these on the ThriveCart hosted success page and before redirecting to any custom success page on your website.

ThriveCart success page variables

There are many variables you can refer to when loading codes on the success page. We use these in our own tracking scripts that we provide for Facebook and Google Analytics. They can be explored via the console using the command console.dir(_thrive_order); which breaks down the amounts paid for individual items like the bump, upsells etc.

_thrive_order.order.id
_thrive_order.order.invoice_id
_thrive_order.order.total // price in cents
_thrive_order.order.total_readable // price formatted nicely
_thrive_order.order.product.total_readable // price formatted nicely for just the main product
_thrive_order.order.bump.total_readable // price formatted nicely for just the bump product
_thrive_order.order.tax // amount of tax paid in cents
_thrive_order.order.tax_readable // tax formatted nicely
_thrive_order.order.currency // USD, GBP etc
_thrive_order.order.affiliate_id
_thrive_order.order.shipping // shipping paid, in cents
_thrive_order.order.shipping_readable // shipping paid, formatted nicely
_thrive_order.customer.name
_thrive_order.customer.email
_thrive.user.campaign_id // ThriveCart tracking ID if set

Troubleshooting

ProblemSolution
I saved my script, but now my checkout appears to be brokenWhen working with custom scripts, we always recommend thoroughly testing your checkout after saving to that product. Some third-party platforms inject code into your checkout pages which may cause conflicts. 

If removing the code resolves the issue, you’ll want to make sure that it’s been copy/pasted in full, troubleshoot the script with the source platform, or consider placing it in your checkout via an HTML element instead.
The script doesn’t seem to be sending data to my third party platformWe can’t guarantee that these fields support every platform’s custom script, but you’ll want to double and triple check that the code entered is complete and not missing anything.  

Frequently Asked Questions (FAQs)

  • Q: Where on my checkout can I see these scripts loading?
    • A: If you want to check if your scripts are working, then the easiest thing would be to test your product via a purchase, and then check your success page for the script/code running. You could use Dev Tools in Chrome, and open the ‘network’ tab to see what events loaded/sent and the response.
  • Q: Where can I find the section of my checkout page to add additional code to?
    • A: Placing your scripts in the tracking scripts section, or in an HTML element on your page would be the only way to currently adjust your ThriveCart checkout page code and use ThriveCart custom scripts.
  • Q: I’m using the built-in Facebook and GTM tools for analytics, do I also need to add a custom script?
    • A: In the majority of cases, no, the integrations would be tracking purchase and transaction data via the built-in functionality already, and adding additional custom scripts could result in duplicate data, so you’ll want to go through the analytics integration setup for those platforms.

      If there is advanced javascript-based tracking that you’re looking to implement, then you may want to consider the ThriveCart custom scripts section for tracking instead of the built-in integrations. 

Still Need Help?

If you’ve followed these steps and are still experiencing issues or have additional questions, please contact our support team here. 

Updated on November 12, 2025
Was this article helpful?

Related Articles