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, so prove the domain with the meta tag or DNS record on the install screen.
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.
Shopify runs the checkout pages, outside your theme. If Shopify's own cookie banner is on, it stays in charge of consent, and our line steps aside without adding a second banner. It still watches your events once a visitor accepts analytics on that banner. Your Google tags hear the visitor's choice whether or not you use Shopify's Google & YouTube app. When you're ready, turn Shopify's banner off, then choose our banner in Settings › Install, with nothing new to paste.
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>. Use the child theme, because a parent-theme update erases your edit. What loads above it matters: a Google tag or pixel plugin placed higher runs before anyone chooses.
If Complianz, CookieYes or Cookiebot is active, you can leave it on for now. Our line stays out of its way and watches your events for visitors who accept analytics there (the plugin's Consent Mode setting needs to be on). When you're ready, deactivate the old plugin, then choose our banner in Settings › Install straight away, or visitors may see two banners.
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, and you paste and publish it in Webflow yourself.
Squarespace
Go to Settings › Developer tools › Code injection (older sites: Settings › Advanced › Code injection) and paste the line at the top of Header. Code injection needs a plan that allows it. Squarespace's own cookie banner can stay on while you try it: it stays in charge of consent, and our line steps aside without adding a second banner. It still watches your events, starting once a visitor accepts (or presses OK on a banner with one button). When you're ready, turn Squarespace's banner off, then choose our banner in Settings › Install straight away.
As with Webflow, an assistant can prepare the line and walk you through it, but you paste and save it yourself.
Wix
Go to Settings › Custom code › Add custom code, paste the line, choose All pages, Load code once, and place it in Head. Wix asks for a published site with a connected domain before you add custom code. Leave the line's code type as Essential, so Wix loads it before any choice.
Next.js
Run this in your project folder:
npx @tagsentry/cli
It writes a small <TagSentry /> component and puts it first in <head> in app/layout.tsx (App Router) or pages/_document.tsx (Pages Router). It also adds a track() helper for your own events. npx @tagsentry/cli undo puts everything back.
Doing it by hand? Render the tag as plain <script> elements inside <head>, never with next/script: none of its strategies runs before your other scripts the way a plain script does. React can't render the tag's onerror text, so use the parts field from the API, or let your coding agent follow 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.