HTML fields: add Cookiebot, GTM, and other scripts to your store
How to use HTML fields in Shoporama to add Cookiebot, Google Tag Manager, Facebook Pixel, chat widgets, and other custom HTML or JavaScript to your online store.
Do you need Cookiebot, Google Tag Manager, Facebook Pixel, a chat widget, or a verification code from Google Search Console on your online store? You add them with HTML fields in Shoporama. Here you can insert the code you got from a third party yourself and choose whether it should be added automatically to the page's <head> or <body>.
How to find HTML fields
- In the left sidebar, find the Webshop section (marked with a gear icon)
- Click HTML fields
How to create an HTML field

- Click Add new HTML field
- Give the field a descriptive name without spaces, for example cookiebot, chat_widget, or gsc_verify. The name is used as the tag name if you later want to call the field manually in a theme
- Paste your code into the text field
- Choose a Location:
- Insert at the end of <head> for verification tags, Cookiebot, and scripts that need to load early
- Insert at the end of <body> for chat widgets and scripts that can wait
- Do not add automatically if you want to control the placement yourself in a private theme
- Click Save
Tip: You can delete a field by emptying its content and clicking Save.
Where does the code end up in the page's HTML?
The choice under Location determines exactly where your code ends up. It's worth knowing when a third party gives clear instructions about where their script should go:
- Insert at the end of <head> – the code is placed at the very end of the page's <head>, after the theme's own meta tags, page title, and stylesheets, but before Shoporama's own tracking script and before code from apps. That's why a cookie banner placed here has time to load before tracking starts
- Insert at the end of <body> – the code is placed at the bottom of the page, right after the theme's own content and JavaScript. The page has finished rendering before your script starts
- Do not add automatically – the code isn't inserted on its own. It's only shown when you call the field's tag name in a theme
An HTML field you create under Webshop → HTML fields is included on all pages of the store, including the cart, checkout, and order confirmation page. If you have several fields with the same location, they're inserted in alphabetical order by field name. If two scripts need to load in a specific order, you can control it with the names, for example 1_cookiebot and 2_chat.
The content is inserted exactly as you wrote it. Shoporama doesn't change your code, and any Smarty code in the field isn't executed. The field is plain HTML.
Typical uses
- Cookiebot – cookie consent banner. If you insert it in the <head>, it can block other tracking scripts until the customer has given consent
- Google Search Console / Bing Webmaster Tools – verification meta tags that confirm you own the domain
- Hotjar, Microsoft Clarity, Mouseflow – heatmaps and session recordings
- Chat widgets – Tidio, Zendesk Chat, Intercom, Drift, and similar
- Custom HTML, CSS, or JavaScript – handy extra features in your own design
Example: verification codes for search engines and ad networks
Google Search Console, Bing Webmaster Tools, Pinterest, and Meta Business Manager all require proof that you own the domain before they give you access to data about your store. They give you a small meta tag that must be on your front page. A meta tag only works if it's in the page's <head>, so the location must always be Insert at the end of <head>.
Create one field, for example verification, and collect all your verification codes in it. A field can contain several lines:
<meta name="google-site-verification" content="YOUR-CODE-FROM-SEARCH-CONSOLE"> <meta name="msvalidate.01" content="YOUR-CODE-FROM-BING"> <meta name="p:domain_verify" content="YOUR-CODE-FROM-PINTEREST"> <meta name="facebook-domain-verification" content="YOUR-CODE-FROM-META">
Replace the values in content="..." with the ones you got from each provider, and only include the lines you actually need. If the provider offers several methods, choose the one called HTML tag or meta tag. That way, you don't have to upload a file to the domain.
Don't use the HTML block in the Page designer for verification tags. In Montana it's called Custom code, and it only inserts code where the block sits on the page, that is, in the page content. The meta tag must be in the page's <head>, so search engines can't find it when it's added with a block. It has to go in an HTML field on this page.
Don't delete the field afterward. Search engines and ad networks check the code again at regular intervals. If it disappears, you lose access to the data and have to verify again from scratch.
A Google Ads conversion ID, a GA4 Measurement ID, or a Facebook Pixel ID, on the other hand, shouldn't go in an HTML field. You enter those under Webshop → Tracking, where Shoporama connects them to e-commerce events for you. See the section HTML fields or Tracking further down.
Example: chat widget and live chat
Tidio, Zendesk, Intercom, Crisp, Smartsupp, and most other chat tools give you a ready-made code snippet that you just copy in. A chat bubble shouldn't be the first thing the customer sees, and it's fine for it to load after the rest of the page. That's why it belongs at the bottom:
- Click Add new HTML field, and name the field, for example, chat_widget
- Paste the entire code snippet from the chat provider, including <script> and </script>
- Set Location to Insert at the end of <body>
- Click Save
The code snippet typically looks like this, where the ID is your account with the provider:
<script src="https://widget.dit-chatvaerktoej.dk/DIN-KONTO-ID.js" async></script>
Heatmaps and session recordings from tools like Hotjar, Microsoft Clarity, or Mouseflow are set up the same way, but they prefer to load early so they can record the entire visit. Always follow the provider's own instructions: if their guide says head, choose Insert at the end of <head>.
If you use a cookie banner, remember that chat, heatmaps, and similar tools often set cookies. They must therefore be marked up according to the cookie banner's instructions, so they only start once the customer has given consent. Read more in our guide to cookie consent and Consent Mode.
Example: your own CSS, JavaScript, and widgets
A small design fix
If you just need to fix a single detail without opening the theme, you can put your CSS in an HTML field with the location Insert at the end of <head>. Because the field is inserted after the theme's stylesheets, your rules generally win over the theme's own:
<style>
/* Replace .your-class with the class you find in the browser's inspector */
.your-class { background: #f5f5f5; }
</style>
If, on the other hand, you have a small piece of JavaScript that should run when the page has loaded, put it in a field with the location Insert at the end of <body>. Keep it to small things: bigger design changes belong in the theme, where they're easier to keep track of.
A widget that should appear in a specific place
Some widgets, such as review displays and price calculators, consist of two parts: a script that loads the tool, and a piece of HTML that determines where on the page the widget is drawn. Split them into two fields:
- Put the script itself in a field with the location Insert at the end of <head> or Insert at the end of <body>, depending on what the provider recommends
- Put the widget code in a field with the location Do not add automatically, and call the tag name in the place in the theme where the widget should appear
Further down, in the section Use HTML fields manually in a theme, you can see how to call the tag name.
HTML fields or Tracking: which should I use?
Shoporama also has a page under Webshop → Tracking with ready-made fields for the most widely used tools:
- Microsoft Ads (Bing)
- Google Analytics 4 (Measurement ID)
- Google Ads Conversion ID
- Pinterest, Snapchat, TikTok, and LinkedIn
- Facebook Pixel ID and Conversion API
If you just have an ID for one of these tools, enter it under Tracking. Shoporama automatically takes care of the correct setup and e-commerce events. Only use HTML fields when you have a code snippet that doesn't fit one of the fixed fields, for example Cookiebot's full script or a verification tag.
Built-in server-side tracking: Shoporama has its own server-side tracking solution (sGTM via Stape). You don't need to set up a Tag Manager yourself. Just enable server-side tracking under Tracking, enter your IDs for GA4, Facebook, and Google Ads, and Shoporama sends e-commerce events server-side. You also get cookieless signals when consent is missing. It's a paid add-on, and the current prices are at https://www.shoporama.io/price.
Your own GTM: If you prefer to manage everything yourself in your own Google Tag Manager container, you can insert the GTM snippet as an HTML field (placed at the end of <head>) and manage Cookiebot, Pixel, Hotjar, and so on inside GTM. The two solutions shouldn't run at the same time.
Use HTML fields manually in a theme
If you have a private theme and want to place an HTML field in a specific spot in your template, set the field to Do not add automatically and call the tag name in your Smarty template:
<{$webshop->getHtmlField('cookiebot')}>
The content is rendered raw, so <script> tags work as expected. Remember to turn off automatic insertion, or the field will be included twice.
HTML fields in other places than the whole store
The HTML field you create under Webshop applies to the entire store. If you only want a script on individual products, categories, pages, blog posts, or landing pages, you can create HTML fields directly on those items on their edit pages. This is handy for things like schema markup or a campaign pixel that should only fire on one landing page.
Important notes on security and speed
- Only insert code from sources you trust. Malicious or faulty JavaScript can affect the entire store, including checkout
- Every extra script costs page speed. Use async or defer if the third party recommends it
- Always test your store afterward, for example by right-clicking in the browser and choosing View page source to check that the code is there
Frequently asked questions
Where do I find HTML fields in the admin?
Go to Webshop → HTML fields. If the menu item isn't visible, your user may be missing permissions. Ask the person who set you up.
Can I break my store by experimenting with HTML fields?
You don't touch your products, orders, or customers. At worst, a faulty code snippet can make pages look strange or affect performance. Empty the field and save, and it's gone again.
I added the meta tag with a block in the Page designer, but Google can't find it. Why?
Because the HTML block in the Page designer (in Montana it's called Custom code) places the code in the page content, not in the page's <head>. A verification meta tag only works in the <head>. Remove the block again, and instead put the tag in an HTML field under Webshop → HTML fields with the location Insert at the end of <head>. Read more about the Page designer.
How do I test whether my HTML field works?
Open the store in a private browser tab, right-click, and choose View page source. Search for a piece of your code (for example a comment or a tag ID). For tracking scripts, you can install browser extensions like Tag Assistant (GTM/GA4) or Pixel Helper (Facebook).
How do I delete an HTML field I no longer use?
Empty all the content in the field and click Save. The field disappears. First check that the tag name isn't called manually somewhere in a private theme, or you may get an empty spot or an error.
What's the difference between Webshop → Tracking and HTML fields?
Tracking has ready-made fields for the most widely used tools (GA4, Facebook Pixel, Google Ads, Microsoft Ads, and so on), where you just enter your ID. In the same place, you can enable Shoporama's built-in server-side tracking, so you don't have to maintain a Tag Manager container yourself. HTML fields are the flexible solution for everything else, such as Cookiebot, verification codes, and chat widgets. If you have the choice, use Tracking, because Shoporama connects the official integrations correctly.
Should Cookiebot go in <head> or <body>?
Cookiebot should go in the <head>, so it has time to block tracking scripts until the customer has given consent. Choose Insert at the end of <head> in the HTML field. Then follow Cookiebot's own instructions for marking other scripts with consent attributes.
Do HTML fields affect page speed?
Yes. Every extra script adds load time and can affect Core Web Vitals. Keep the number down, use async or defer where possible, and consider collecting several scripts in Google Tag Manager, so they load from one controlled place.
Do I have to set it up again in each of my stores?
Yes. HTML fields are per store. If you want to keep things consistent across several stores, the easiest way is to put everything in one GTM container and insert the GTM snippet as an HTML field in each store.
I saved my HTML field, but the code doesn't show up in the store
First check that Location isn't set to Do not add automatically. If it is, the code is only shown when it's called from the theme. If the location is correct, it's usually because the pages of a live store are stored in an HTML cache for up to four hours. You always see the latest version if you're logged in to the admin in the same browser, have something in the cart, or add a random parameter to the address, for example ?test=1. After four hours at the latest, the cache has renewed itself, and all visitors see the code.
Should my chat widget go in head or body?
Body. A chat bubble doesn't need to be ready before the page has rendered, and a script in the <head> delays when the content is shown. Choose Insert at the end of <body>. The exceptions are tools that ask for head themselves: cookie banners that need to block other scripts in time, and heatmap tools that need to record the entire visit.
Can I add a script to just one campaign page or one product?
Yes. The same HTML fields exist on each product, category, page, blog post, and landing page. A field on, for example, a landing page is only inserted when exactly that page is shown, and it's placed after the field that applies to the whole store. This is handy if an advertising partner requires a pixel on one campaign page without it firing on the rest of the store.
The provider asks me to upload an HTML file to my domain. What do I do?
Choose a different method. Almost all search engines and ad networks also offer verification with a meta tag, and that's the method that works with HTML fields. You just copy the tag into a field with the location Insert at the end of <head> and click Save. If you can only use the file method, write to support@shoporama.dk, and we'll find a solution.
If you have any questions, feel free to write to us at support@shoporama.dk.
Related articles
Server-side tracking in Shoporama: GA4, Meta, and Google Ads
A complete guide to server-side tracking in Shoporama. Better data quality, fewer conversions lost to ad blockers, and product IDs that match your...
Cookie consent banner and Google Consent Mode v2
How to set up Shoporama's free cookie consent app: cookie categories, automatic blocking, withdrawing consent, and Google Consent Mode v2.
GDPR and cookie consent rules for your online store
An overview of the GDPR and cookie rules for online stores: consent before tracking, documentation, and a cookie policy, and how Shoporama meets...
Data processing agreement (DPA)
How to sign the data processing agreement with Shoporama in accordance with the GDPR.
Page designer: drag-and-drop page builder for your store
Learn how to use the Page designer in Shoporama to build page layouts with blocks such as hero sections, product lists, banners, and much more,...
Related features
dataLayer
The dataLayer connects your online store to Google Tag Manager. Learn how ecommerce data such as product views and purchases is passed on to your...
Exit-intent popup
An exit-intent popup appears when a visitor is about to leave your online store. Learn about triggers, what to show, Shoporama's popups, and best...
Google Tag Manager (GTM)
Google Tag Manager manages tracking codes without code changes. Learn about GTM, tags, triggers, and ecommerce tracking for online stores, and when...
Slide-in
A slide-in slides in from the edge of the screen with an offer or newsletter signup. Learn about types, triggers, Shoporama's slide-ins, and best...
Sticky bar
A sticky bar is a fixed bar in your online store with key messages like free shipping and campaigns. Learn about typical uses, impact, and best...
Google Consent Mode
Consent Mode adjusts Google tags to each visitor's cookie consent. Learn how it works, why v2 is required, and how to set it up in your online store.
Server-side GTM (sGTM)
Server-side GTM is a tag container on a server that receives events from your online store through your own domain. Learn client-side vs....
Cookie consent: free and GDPR-friendly
Free cookie consent included in Shoporama. Google Consent Mode, categorized cookies, automatic blocking, and consent logging. Ready for the GDPR.
Server-side tracking: more accurate data for your ads
Server-side tracking for Google, Meta, Pinterest, TikTok, and Snapchat. Less affected by ad blockers. Available as an add-on on Pro and Flex.
Delaware: checkout, emails, and integrations
Every field in Delaware's theme settings for checkout, emails, terms of service, integrations, and error pages explained, with tags, examples, and...