HTML fields: Insert Cookiebot, GTM and other scripts in your online store
How to use Shoporama HTML fields to insert Cookiebot, Google Tag Manager, Facebook Pixel, chat widgets and other custom HTML/JavaScript on your online store.
Do you need a Cookiebot, Google Tag Manager, Facebook Pixel, a chat widget or a verification code from Google Search Console on your webshop? You do this via HTML fields in Shoporama. Here you can insert the code you've received from a third party and choose whether to insert it automatically in the <head> or <body> of the page .
How to find HTML fields
- Click the gear in the top right corner to open Settings
- Select Online Shop from the menu
- Click HTML fields
To create an HTML field
- Click Add new HTML field
- Give the field a descriptive name without spaces, such as cookiebot, chat_widget or gsc_verify. The name is used as a tag name if you later want to call the field manually in a theme
- Paste your code in the text field
- Select Location:
- Insert at the end of <head> for verification tags, Cookiebot and scripts that need to load early
- Add last in <body> for chat widgets and scripts that need to wait
- Don't add automatically if you want to control the placement in a private theme
- Click Save
Tip: You can delete a field by emptying the content and clicking Save.
Typical uses
- Cookiebot - cookie consent banner. If you insert it first in <head>, it can block other tracking scripts until the customer has given consent
- Google Search Console / Bing Webmaster Tools - verification meta tags that confirm that 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 - smart extra features in your own design
HTML fields or Tracking - what do I use?
Shoporama also has a page under Settings → Online Shop → Tracking with ready-made fields for the most commonly used tools:
- Google Tag Manager (GTM-ID)
- Google Analytics 4 (Measurement ID)
- Google Ads Conversion ID
- Google Merchant ID
- Facebook Pixel ID and Conversion API
If you only have an ID for one of these tools, enter it under Tracking. Shoporama will automatically take care of the correct setup and e-commerce events. Only use HTML fields when you have a piece of code that doesn't fit into one of the fixed fields, such as 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 - simply enable server-side tracking under Tracking, enter your IDs for GA4, Facebook and Google Ads, and Shoporama will send e-commerce events server-side. You also get cookie-less signals for lack of consent. Optional from 89 kr/md ex. VAT.
Own GTM: If you prefer to manage everything yourself in your own Google Tag Manager container, you can insert your GTM ID under Tracking and manage Cookiebot, Pixel, Hotjar etc. inside GTM. The two solutions should not run simultaneously.
Use HTML fields manually in a theme
If you have a private theme and want to place an HTML field at a specific location in your template, set the field to Don't 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 auto-insertion, otherwise the field will be included twice.
HTML fields elsewhere than on the online shop
The HTML field you create under Settings → Online shop applies to the entire online shop. If you only want a script on individual products, categories, pages, blog posts or landing pages, you can create HTML fields directly on these objects under their respective edit pages. This is handy for e.g. schema markup or a campaign pixel that only needs to be fired on one landing page.
Important about security and speed
- Only insert code from sources you trust. Bad or faulty JavaScript can affect the entire shop, including the checkout
- Every extra script costs in page speed. Use async or defer if third parties recommend it
- Always test on your shop afterwards, for example by right-clicking in the browser and selecting View source code to see that the code is included
Frequently asked questions
Where do I find HTML fields in the admin?
Go to Settings → Online shop → HTML fields. If the menu item is not visible, your user may lack rights - ask the person who set you up.
Can I mess up my shop by messing with HTML fields?
You don't touch your products, orders and customers. At worst, a wrong snippet of code can make pages look strange or affect performance. Clear the field and save, and it's gone again.
How do I test if my HTML field works?
Open the shop in a private browser tab, right-click and select View source code. Look up a piece of your code (e.g. 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 the entire content of the field and click Save. The field will disappear. First check that the tag name is not manually called somewhere in a private theme, otherwise you may get a blank spot or an error.
What is the difference between Settings → Tracking and HTML fields?
Tracking has ready-made fields for the most commonly used tools (GA4, Facebook Pixel, Google Ads, Microsoft Ads, etc.) where you simply insert your ID. In the same place, you activate Shoporama's built-in server-side tracking so you don't have to maintain a Tag Manager container yourself. HTML fields are the free solution for everything else - like Cookiebot, verification codes and chat widgets. If you have the choice, use Tracking - Shoporama connects the official integrations correctly.
Should Cookiebot be placed in <head> or <body>?
Cookiebot should be inserted first in the <head> to block tracking scripts until the customer has given consent. Therefore, select Insert last in <head> in the HTML field. Then follow Cookiebot's own instructions to tag other scripts with consent attributes.
Do HTML fields affect page speed?
Yes - each additional script costs in load time and can affect Core Web Vitals. Keep the number down, use async or defer where possible, and consider bundling multiple scripts in Google Tag Manager so they load managed in one place.
Do I have to set it up again in each of my eCommerce stores?
Yes - HTML fields are per online store. If you want to keep it consistent across multiple shops, the easiest way is to put everything in one GTM container and only insert the GTM ID under Tracking in each shop.
If you have any questions, feel free to contact us at support@shoporama.dk.
Related articles
Server-side tracking in Shoporama
Guide to setting up server-side tracking on your Shoporama webshop for better data quality.
Cookie consent and Consent Mode v2
Guide to setting up cookie consent with Google Consent Mode v2 in Shoporama to comply with GDPR and optimize your tracking.
Cookie consent and GDPR
Guide to cookie consent and GDPR in Shoporama, including Google Consent Mode v2, cookie categories and revoking consent.
Data Processor Agreement
Guide to approving the data processing agreement with Shoporama under the GDPR.