How to add custom code to your store
Add verification tags, chat widgets or other snippets to every page of your store, and use ?safe=1 if a snippet breaks it.
Add your own code snippets to every page of your store, for example a Google site-verification tag, a live chat widget, or a review tool. If a snippet ever breaks your store, you can open it in safe mode and fix it.
Before you start
- You need an online store. See How to set up your online store.
- Have the snippet ready from the service you use. Only paste code from services you trust: it runs for every shopper on your store.
- For Facebook, TikTok, Google Analytics, Google Ads or Tag Manager, use Tracking & Pixels instead. It's easier and also sends purchase events.
Steps
- In the left menu, open Store → Website → Settings, then the Custom code tab.
- Turn on Add custom code to my store.

Read the warning (1), turn on Add custom code to my store (2), and paste your snippet under Header code (3). - Paste code that must load first into Header code.
<meta>and<link>tags go into the page's head, so site-verification tags work here. - Paste chat widgets and scripts that don't need to load first into Footer code.
- Click Save. You'll see “Custom code saved”.
- Open your store at its real address and check that the snippet works.
If a snippet breaks your store
- Open your store and add ?safe=1 to the end of the address, for example https://yourstore.ecomup.ai/?safe=1. Or click Open my store without custom code at the bottom of the Custom code page.
- Your store loads without any custom code, so you can check everything else still works.
- Back on the Custom code page, fix or delete the bad snippet, or turn off Add custom code to my store.
- Click Save.
Tips
- Custom code only runs on your live store (your subdomain or custom domain). It never runs in the dashboard or in theme previews.
- Turning off Add custom code to my store stops all your snippets at once without deleting what you wrote.
- Each box can hold up to 50,000 characters. The counter under each box shows how much you've used.
- Click Discard to undo changes you haven't saved yet.
- Want to add the EcomUp chat widget to another website? See Chatbot widget.
Troubleshooting
The Save button is greyed out
Either nothing has changed, or one of the boxes is over 50,000 characters (the counter turns red). Shorten the code and try again.
“Could not save the custom code”
Your changes weren't saved. Check your connection and try again. If you see this repeatedly, your role may not have permission to edit the website.
My snippet doesn't run
Check that Add custom code to my store is on and you clicked Save. Test on your live store address, not the dashboard preview, and make sure you didn't open it with ?safe=1.
Google says my verification tag isn't found
Put the <meta name="google-site-verification" …> tag in Header code, save, then verify using the same address Google is checking (subdomain or custom domain).