Installation
Installing the Sealmetrics tracker adds cookieless, consentless analytics to your site — it fires the initial pageview automatically and exposes the sealmetrics object for tracking conversions and microconversions. The method is a single <script> tag with your Site ID, placed in your page's <head>.
Basic Installation
Add this script tag to your HTML, preferably in <head>:
<script src="https://t.sealmetrics.com/t.js?id=YOUR_SITE_ID" defer></script>
Replace YOUR_SITE_ID with your Sealmetrics Site ID (found in Settings → Sites → [your site]).
The defer attribute ensures the script loads asynchronously without blocking page rendering.
With Content Grouping
Content grouping categorizes pages into sections for analysis (e.g., "blog", "product", "checkout").
Add the group parameter:
<!-- Blog pages -->
<script src="https://t.sealmetrics.com/t.js?id=YOUR_SITE_ID&group=blog" defer></script>
<!-- Product pages -->
<script src="https://t.sealmetrics.com/t.js?id=YOUR_SITE_ID&group=product" defer></script>
<!-- Documentation pages -->
<script src="https://t.sealmetrics.com/t.js?id=YOUR_SITE_ID&group=docs" defer></script>
<!-- Checkout flow -->
<script src="https://t.sealmetrics.com/t.js?id=YOUR_SITE_ID&group=checkout" defer></script>
Content grouping enables reports like:
- Conversions by content group
- Bounce rate per section
- Traffic distribution across page types
Custom Endpoint
For self-hosted deployments or custom domains:
<script src="https://your-pixel-domain.com/t.js?id=YOUR_SITE_ID" defer></script>
Parameters Reference
| Parameter | Required | Description | Example |
|---|---|---|---|
id | Yes | Your Sealmetrics Site ID | id=67a1d6c0bb10b861397fdd3a |
group | No | Content grouping for this page. Must match ^[a-zA-Z0-9_-]{0,64}$; an invalid value makes /t.js return HTTP 400 | group=blog |
auto | No | Set auto=0 to suppress the automatic initial pageview (manual mode). Any other value keeps it on | auto=0 |
Manual Pageview Mode (auto=0)
By default the tracker fires the initial pageview as soon as it loads. Add auto=0 to keep everything wired up (SPA listeners, conv(), micro()) while firing the pageview yourself — useful when you need to set a content group after your dataLayer is ready:
<script src="https://t.sealmetrics.com/t.js?id=YOUR_SITE_ID&auto=0" defer></script>
<script>
window.addEventListener('load', function () {
sealmetrics({ group: 'checkout' });
});
</script>
Deferred Loading / GTM (pre-load queue)
If a sealmetrics(...) call may run before the library finishes loading (e.g., Google Tag Manager), inject this fbq-style stub before the script tag. It buffers calls in sealmetrics.q and replays them once the library boots:
<script>
!function(w){w.sealmetrics=w.sealmetrics||function(){(w.sealmetrics.q=w.sealmetrics.q||[]).push(['pv',arguments])};w.sealmetrics.q=w.sealmetrics.q||[];w.sealmetrics.conv=w.sealmetrics.conv||function(){w.sealmetrics.q.push(['cv',arguments])};w.sealmetrics.micro=w.sealmetrics.micro||function(){w.sealmetrics.q.push(['mc',arguments])}}(window);
</script>
When using the stub to enqueue a pageview, load the tracker with auto=0 so the queued pageview and the automatic one do not both fire. See the API Reference for details.
What Happens After Installation
- The script loads asynchronously (does not block rendering)
- A session ID is generated automatically without cookies
- An anti-spam token is validated (embedded in the script, valid for 24 hours)
- The initial pageview is tracked automatically
- SPA navigation is detected automatically (History API)
Verifying Installation
Option 1: Browser Console
Open DevTools (F12) and type:
typeof sealmetrics === 'function'
// Should return: true
Option 2: Network Tab
- Open DevTools > Network
- Filter by "event"
- Reload the page
- Look for a POST request to
/eventwith status 204
Option 3: Inspect Tracker State
In the console you can read the tracker's own state to confirm it initialized correctly:
sealmetrics.sessionId; // current session ID
sealmetrics.accountId; // your site ID
sealmetrics.autoMode; // "1" (auto-pageview) or "0" (manual mode)
Common Installation Patterns
WordPress (without plugin)
Add to header.php or use a "Header Scripts" plugin:
<script src="https://t.sealmetrics.com/t.js?id=YOUR_SITE_ID" defer></script>
Next.js
In app/layout.tsx or pages/_app.tsx:
import Script from 'next/script';
export default function RootLayout({ children }) {
return (
<html>
<head>
<Script
src="https://t.sealmetrics.com/t.js?id=YOUR_SITE_ID"
strategy="afterInteractive"
/>
</head>
<body>{children}</body>
</html>
);
}
Nuxt.js
In nuxt.config.ts:
export default defineNuxtConfig({
app: {
head: {
script: [
{
src: 'https://t.sealmetrics.com/t.js?id=YOUR_SITE_ID',
defer: true
}
]
}
}
});
Google Tag Manager
- Create a new Custom HTML tag
- Paste:
<script src="https://t.sealmetrics.com/t.js?id=YOUR_SITE_ID" defer></script>
- Set trigger to "All Pages"
- Publish
Shopify
- Go to Online Store > Themes > Edit code
- Open
theme.liquid - Add before
</head>:
<script src="https://t.sealmetrics.com/t.js?id=YOUR_SITE_ID" defer></script>
Troubleshooting
Script not loading
- Check that
YOUR_SITE_IDis replaced with your actual Site ID - Verify the site is active in Sealmetrics dashboard
- Check browser console for errors
Events not appearing in dashboard
- Events are processed in batches; wait 2-5 minutes
- Verify the domain is registered in Settings → Sites → [your site] → Domains
- Check if adblockers are blocking requests (unlikely with first-party setup)
204 response but no data
The server returns 204 for all requests (valid or rejected) to prevent information leakage. Check:
- Site ID is correct
- Domain is authorized for this site
- Token is valid (script was loaded less than 24 hours ago)
Need help with installation? Contact us at support@sealmetrics.com or start your free trial.