Skip to main content
The Custom HTML section in Upcart allows you to insert custom code into various parts of the cart drawer.
You can also write JavaScript using <script> tags, and interact with the cart using Upcart’s Public API (e.g., upcartOnCartLoaded (deprecated — use upcartSubscribeCartLoaded for new scripts)).

Where to Find It

Go to: Cart Editor > Settings > Custom HTML

How It Works

The HTML Location dropdown lets you choose where the code will appear inside the cart layout. Based on your selection, the code will be injected into the corresponding cart area. You can use this to add:
  • Custom messages
  • Trust text
  • App integrations
  • Analytics snippets
  • Styling hooks
  • Promotional content, such as banners with personalized offers or discounts
  • Product guarantees that build customer confidence

Dynamic Tokens

You can use the following token inside any Custom HTML field to inject live cart data: Example:
This token works in all HTML location fields except Scripts (Before Load), where you should use the JavaScript API instead. This is the only dynamic token available in Custom HTML fields.

Available HTML Locations

Custom CSS (Optional)

You can style your HTML using the Custom CSS editor found under:
Upcart > Cart Editor > Settings > CSS
For example, to adjust empty cart alignment: