How can we help?

Where to Place the HTML Tracking Codes?

01/06/2025

Where I should place ClickSambo HTML tracking code

To ensure your website is fully protected, you must install two separate ClickSambo tracking codes in two specific locations on every page you wish to monitor.

Each code has a distinct role, and its placement is critical for optimal performance.

Tracking Code (HEAD Section): This is your primary detection engine. Placing it in the <head> ensures it loads as early as possible to analyze visitor behavior and detect real-time threats.

NoScript Tracking Code (BODY Section): This is your essential safety net. Placing it at the beginning of the <body> guarantees tracking coverage even if a user has JavaScript disabled—a common tactic used by bots.

General Placement Rules

Here are the universal rules for placing your codes, regardless of your website platform:

Tracking Code (HEAD Section)

Where: Inside the <head>...</head> section of your website's HTML.

Best Practice: Place it just before the closing </head> tag.

NoScript Tracking Code (BODY Section)

Where: Inside the <body>...</body> section of your website's HTML.

Best Practice: Place it immediately after the opening <body> tag.

How to Install the Codes on Your Website

The best way to add these codes to every page is to use a site-wide tool or template.

Recommended Method: Use your website platform's built-in tool for adding custom code. Platforms like Wix, Squarespace, and BigCommerce have dedicated features (e.g., "Custom Code," "Code Injection") that are the safest and easiest way to install the codes in the correct locations.

Alternative Method (Theme Editing): If your platform does not have a code injection tool, you will need to edit your site's main template file. This is common for platforms like WordPress and Shopify. You would add the codes to a file that controls your site-wide header (e.g., header.php or theme.liquid).

For detailed, step-by-step instructions for your specific platform, please see our dedicated guides: How to Install ClickSambo with Google Tag Manager (GTM) 

Final Checklist

After adding the codes, always complete these final steps:

Clear All Caches: This is a mandatory step. You must clear all website, server, or CDN (e.g., Cloudflare) caches for your changes to appear on the live site.

Verify Installation: Open your live website in an incognito window and "View Page Source". Confirm that the HEAD code appears in the <head> section and the BODY code appears right after the opening <body> tag.

Did this answer your question?
Customise Consent Preferences
Cookies

CookieConsentIntro

CookieConsentNecessary

CookieConsentThirdParty

CookieConsentChoice

Show More
Cookies Necessary
Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

Cookies Functional

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

Cookies Analytics

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Cookies Performance

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Cookies Advertisement

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

Cookies Uncategorised

Other uncategorised cookies are those that are being analysed and have not been classified into a category as yet.