Guide: Where to Add Tracking and Custom Code in the Booking Engine
Within our marketplace add-on Custom Code for Booking Engine, there are two available input fields:
Custom Code for Head
Custom Code for Body
These fields allow you to insert third-party scripts and integrations into your Booking Engine, such as Google Analytics, Google Tag Manager, Meta Pixel, verification tags, and similar tools.
What goes into Custom Code for Head
The Custom Code for Head field is used for code that should be loaded inside the HTML <head> section.
This usually includes:
Google Analytics / Google Tag (
gtag.js)Meta Pixel main script
Google Tag Manager main script
verification meta tags
other tracking or analytics scripts that the provider documentation says should be placed in
<head>
In most cases, this is where standard tracking scripts should be added.
What goes into Custom Code for Body
The Custom Code for Body field is used for code that should be inserted inside the HTML <body> section.
This usually includes:
noscriptfallback codeGoogle Tag Manager iframe fallback
Meta Pixel
noscriptsectionany code that the provider explicitly says should be placed immediately after the opening
<body>tag
Important: if a tool provides two separate code snippets, one for <head> and one for <body>, both parts should be added into their matching fields.
Most common integrations and where to place them
1. Google Analytics 4 / Google Tag (gtag.js)
If you are using Google Analytics 4 through gtag.js, the full code is usually added to:
Custom Code for Head
Example:
<!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XXXXXXXXXX'); </script>Where it goes: Custom Code for Head
2. Google Tag Manager (GTM)
Google Tag Manager usually comes in two parts:
Part 1: script code
This goes into:
Custom Code for Head
Example:
<!-- Google Tag Manager --> <script> (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-XXXXXXX'); </script> <!-- End Google Tag Manager -->Part 2: noscript code
This goes into:
Custom Code for Body
Example:
<!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) -->
Where it goes:
script part →
Custom Code for Headnoscriptpart →Custom Code for Body
3. Meta Pixel
Meta Pixel also often comes in two parts:
Part 1: main script
This goes into:
Custom Code for Head
Example:
<!-- Meta Pixel Code --> <script> !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window, document,'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', 'XXXXXXXXXXXXXXX'); fbq('track', 'PageView'); </script> <!-- End Meta Pixel Code -->Part 2: noscript fallback
This goes into:
Custom Code for Body
Example:
<noscript> <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=XXXXXXXXXXXXXXX&ev=PageView&noscript=1"/> </noscript>
Where it goes:
script part →
Custom Code for Headnoscriptpart →Custom Code for Body
4. Google Ads Conversion Tag
Google Ads conversion code is in most cases a script that should be added to:
Custom Code for Head
If there is an additional event snippet or custom conversion logic, the exact implementation may vary depending on the setup.
Most common placement: Custom Code for Head
5. Verification meta tags
Verification codes for services such as:
Google Search Console
Facebook domain verification
Pinterest verification
similar tools
usually go into:
Custom Code for Head
Example:
<meta name="google-site-verification" content="..." />
Where it goes: Custom Code for Head
6. Live chat, widgets, and third-party JS tools
Tools such as:
live chat widgets
CRM tracking scripts
remarketing scripts
heatmap tools
session recording tools
will in most cases go into:
Custom Code for Head
However, always follow the provider’s documentation. If the tool explicitly says the code should be added inside <body>, then it should be placed into Custom Code for Body.
How to decide where the code should go
The simplest rule is:
if the provider says paste this into the
<head>→ add it to Custom Code for Headif the provider says paste this right after the opening
<body>tag → add it to Custom Code for Bodyif there is a
<noscript>section, it usually goes into Bodyif there is only one standard analytics or tracking script, it usually goes into Head
Recommendation for developers
If the integration provides:
only one code snippet
it should usually be placed into:
Custom Code for Head
two separate code snippets
the usual logic is:
script part → Custom Code for Head
noscript/ iframe fallback part → Custom Code for Body
Important notes
The code should be copied exactly as provided, unless the provider documentation says otherwise.
Make sure IDs such as
G-XXXXXXXXXX,GTM-XXXXXXX, or Pixel ID are replaced with the actual values from your account.If you are not sure where the code should go, always follow the official documentation of the tool you are integrating.
Incorrect placement may result in tracking not working properly.
Quick overview
Integration | Custom Code for Head | Custom Code for Body |
Google Analytics 4 / Google Tag | Yes | No |
Google Tag Manager | Yes | Yes ( |
Meta Pixel | Yes | Yes ( |
Google Ads tag | Yes | Usually no |
Verification meta tags | Yes | No |
Chat / widget / third-party scripts | Usually yes | If required |
