Install by platform
Where the line goes on Shopify, WordPress, Webflow, Squarespace, Wix, Next.js and plain HTML, and how to check it worked.
The rule is the same everywhere: the TagSentry line is the first script in <head>, above Google Tag Manager, gtag.js and any pixel. Only <meta charset> and <meta name="viewport"> may come before it.
How to check it worked
Open your live site, choose View page source, and search for tagsentry. It should appear in the source (not only in the browser's inspector), and before googletagmanager.com. If it isn't in the source, your platform added it with JavaScript, and the domain can't be proven from it.
Shopify
- Go to Online Store › Themes, then Duplicate your live theme as a backup.
- On the live theme, choose Edit code and open
layout/theme.liquid. - Paste the line right after
<head>, above{{ content_for_header }}and above any Tag Manager code. - Save.
Checkout pages are Shopify's and are outside your theme. If Shopify's own cookie banner is turned on, turn it off so visitors see one banner, not two. Our Shopify app is built but not published yet.
WordPress
Add the line with a header-code plugin set to its earliest position, or in your child theme's header.php right after <head>. Never edit the parent theme: an update will erase it.
If Complianz, CookieYes or Cookiebot is active, choose one consent tool. Two banners fight each other.
Webflow
Go to Site settings › Custom code › Head code and paste the line at the top of the box, above any Tag Manager code. Publish the site. Custom code needs a paid site plan. If you use Webflow's built-in consent or its Google Analytics field, turn those off or tell us, because they load outside this order.
An AI assistant can tell you exactly what to paste, but it can't click inside Webflow for you: you paste and publish it yourself.
Squarespace
Go to Settings › Developer tools › Code injection (older sites: Settings › Advanced › Code injection) and paste the line at the top of Header. Turn off Squarespace's own cookie banner. Code injection needs a plan that allows it.
As with Webflow, an assistant can prepare the line and walk you through it, but you do the pasting and saving.
Wix
Go to Settings › Custom code › Add custom code, paste the line, choose All pages, Load code once, and place it in Head. Custom code needs a premium plan. Turn off Wix's own cookie banner.
Next.js
Render the tag as a plain <script> inside <head> in app/layout.tsx (App Router) or pages/_document.tsx (Pages Router). Don't use next/script: none of its strategies runs before your other scripts the way a plain script in the HTML does.
React can't render the tag's onerror text as written, and the inline snippet from For developers is raw HTML too, so neither pastes into JSX. For React apps, use the parts field from the API, which is laid out for a root layout, or let your coding agent do it with our install brief.
Then check the rendered HTML with curl -s https://yoursite.com/ | head -c 4000: TagSentry must be the first script, before gtm.js.
Plain HTML
Paste the line as the first element after <meta charset> and <meta name="viewport"> in every page's <head>, above the Tag Manager <script>. Leave Tag Manager's <noscript> iframe in <body> where it is.