Platforms
Step-by-step guides for putting the Nordtally script on the platforms most sites are built with. Each one puts the same tag on every page. Start from the snippet on your install page rather than the one below: it already has your site id and your settings in it.
- Add it once per page template, so it runs on every page. Head or end of the body both work, since the tag is
defer. Where a platform offers head code, use it. - Single-page apps and history navigation are counted automatically. The script hooks
pushState,replaceStateandpopstate. Only hash-based routers needdata-hash. - Consented mode needs the consent bridge as well. Add its second tag on each platform, as described in the consented mode section.
- Check it works at the end of this page once the tag is live.
Webflow
Paste the tag into the site-wide Head code field, which goes inside the <head> of every page.
- Open your site in the Webflow Designer and go to Site settings.
- Open the Custom code tab.
- Paste the tag into Head code and click Save changes.
- Publish the site. Custom code only appears on the published site.
<script defer data-site="YOUR_SITE_ID" src="https://in.nordtally.com/s.js"></script>- Plan: custom code needs a paid site plan. The free Starter plan doesn’t have it.
- Single-page routes are counted automatically. For one page only, the page settings have a field for code inside the
<head>. - CSP: if you add a Content-Security-Policy, allow
https://in.nordtally.cominscript-srcandconnect-src.
Source: Webflow help, custom code in head and body tags.
Squarespace
Use the site-wide Header code injection, which goes inside the <head> of every page.
- In the Squarespace admin, open Settings, then Advanced, then Code Injection.
- Paste the tag into the Header box and save.
<script defer data-site="YOUR_SITE_ID" src="https://in.nordtally.com/s.js"></script>- Plan: code injection is included on the Core, Plus and Advanced plans, according to Squarespace’s help article.
- Single-page routes are counted automatically.
- CSP: if a Content-Security-Policy applies to your pages, allow
https://in.nordtally.cominscript-srcandconnect-src.
Source: Squarespace help, adding code to the header or footer.
Wix
Add the tag as a custom code snippet placed in the Head.
- In your site’s dashboard, go to Settings.
- Under Development and integrations, click Custom Code.
- Click + Add Custom Code and paste the tag into the text box.
- Give the code a name, such as Nordtally.
- Under Add Code to Pages, choose All pages. Choose to load the code on each page a visitor opens, not once per visit, so every page view is counted.
- Under Place Code in, choose Head.
- Click Apply and publish the site.
<script defer data-site="YOUR_SITE_ID" src="https://in.nordtally.com/s.js"></script>- Your site must be published and have a connected domain before custom code is added.
- Single-page routes are counted automatically. Wix’s help article doesn’t list a plan requirement for custom code, so check the Custom Code panel on your own plan.
- CSP: if a Content-Security-Policy applies to your pages, allow
https://in.nordtally.cominscript-srcandconnect-src. Wix’s help doesn’t cover CSP, so check your own policy.
Source: Wix developer docs, about custom code and Wix help, embedding custom code to your site.
Ghost
Use the site-wide Site Header code injection, which Ghost places inside the <head> of every page.
- In the Ghost admin, go to Settings, then Advanced, then Code Injection.
- Paste the tag into Site Header and save.
<script defer data-site="YOUR_SITE_ID" src="https://in.nordtally.com/s.js"></script>- Single-page routes are counted automatically.
- CSP: if your Ghost site sends a Content-Security-Policy through a proxy or CDN in front of it, allow
https://in.nordtally.cominscript-srcandconnect-src.
Source: Ghost help, code injection.
Framer
Add the tag to the site-wide custom code. It loads on every published page, but not in the editor preview.
- Open the project and go to Site Settings.
- Find the Custom Code section.
- Paste the tag into the head section (Framer offers the start or end of the head and body) and save.
- Publish the site, then open the live page to check it.
<script defer data-site="YOUR_SITE_ID" src="https://in.nordtally.com/s.js"></script>- Framer doesn’t show the tag in the canvas preview, so check the published site instead of the editor.
- Single-page routes are counted automatically.
- CSP: if a Content-Security-Policy applies to your pages, allow
https://in.nordtally.cominscript-srcandconnect-src. Framer’s lesson doesn’t cover CSP.
Source: Framer, custom code.
WordPress
On a self-hosted WordPress site, put the tag in the <head> of your theme so it appears on every page. A plugin that does this for you with a settings field is coming, but there is no date for it yet.
- Open Appearance, then Theme File Editor, and choose the theme’s
header.php. Use a child theme, so an update doesn’t remove your change. - Paste the tag just before
</head>, then save.
<script defer data-site="YOUR_SITE_ID" src="https://in.nordtally.com/s.js"></script>- Block themes have no
header.php. Use a header code plugin you trust, or add the tag to the theme’s template part for the header. - Single-page routes are counted automatically. If you use a caching plugin, clear its cache after you change the theme file.
- CSP: if a security plugin sets a Content-Security-Policy, allow
https://in.nordtally.cominscript-srcandconnect-src.
Hugo, Jekyll and Eleventy
Static sites have one base layout that every page uses. Put the tag in its <head> once, and every page gets it at build time.
- Hugo: the
<head>inlayouts/_default/baseof.html, or in the partial it includes, such aslayouts/partials/head.html. - Jekyll: the
<head>in_layouts/default.html. - Eleventy: the
<head>in your base layout, for example_includes/base.njk.
<script defer data-site="YOUR_SITE_ID" src="https://in.nordtally.com/s.js"></script>- Rebuild and deploy after you change the layout. Nothing is injected at runtime.
- Single-page routes aren’t an issue here, since each page is a full page load. Client-side routing added by a JavaScript framework is covered by the history hooks.
- CSP: your host sets the headers. If it sends a Content-Security-Policy, allow
https://in.nordtally.cominscript-srcandconnect-src.
Next.js
In the App Router, load the script in your root layout with next/script. The script then loads on every route, and only once even when visitors navigate between pages.
import { headers } from 'next/headers'
import Script from 'next/script'
export default async function RootLayout({ children }: { children: React.ReactNode }) {
// The nonce comes from your proxy when the CSP has one. Without a nonce, leave it out.
const nonce = (await headers()).get('x-nonce') ?? undefined
return (
<html lang="en">
<body>
{children}
<Script
src="https://in.nordtally.com/s.js"
data-site="YOUR_SITE_ID"
strategy="afterInteractive"
nonce={nonce}
/>
</body>
</html>
)
}strategy="afterInteractive"is the default. It starts loading after the page is hydrated, which is early enough for pageviews. UsebeforeInteractiveonly if you need the script to run before any Next.js code.- Extra attributes such as
data-outboundpass through to the script element. For the pinned tag from the install page, copy itsintegrityandcrossoriginvalues onto the sameScript. - Consented mode: add a second
Scriptwithsrc="https://in.nordtally.com/s.consent.js"and the samenonce. - Nonce-based CSP: next/script doesn’t add a nonce to your own
Scripttags unless you pass one. Read it from thex-nonceheader set by your proxy, as above. Callingheaders()makes every page under the layout render per request, so skip the nonce if your app is static. - CSP: with
'strict-dynamic'the nonced tag is what lets the script run. Addhttps://in.nordtally.comtoconnect-srcso the events can be sent. Older browsers ignore'strict-dynamic'and need the host inscript-src, so add it there too.
Nuxt
Add the script to app.head in nuxt.config.ts. It renders into the <head> of every page.
export default defineNuxtConfig({
app: {
head: {
script: [
{
src: 'https://in.nordtally.com/s.js',
defer: true,
'data-site': 'YOUR_SITE_ID',
tagPosition: 'head',
},
],
},
},
})- Single-page routes are counted automatically, including Nuxt’s client-side navigation.
- CSP: if you use a security module that adds a nonce, follow its guide for nonces on scripts you add yourself, then allow
https://in.nordtally.cominscript-srcandconnect-src.
Source: Nuxt docs, SEO and meta for app.head and tagPosition. The defer key is not on that page; it is an Unhead attribute, so check the output in the page source.
Astro
Put the tag in the <head> of your base layout component. Every page that uses the layout gets it.
---
---
<html lang="en">
<head>
<meta charset="utf-8" />
<title>My site</title>
<script defer data-site="YOUR_SITE_ID" src="https://in.nordtally.com/s.js"></script>
</head>
<body>
<slot />
</body>
</html>- Single-page routes are counted automatically.
- CSP: if a Content-Security-Policy applies to your pages, allow
https://in.nordtally.cominscript-srcandconnect-src.
SvelteKit
Put the tag in src/app.html, the page template that wraps every page. Add it inside the <head>, outside the %sveltekit.head% placeholder.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script defer data-site="YOUR_SITE_ID" src="https://in.nordtally.com/s.js"></script>
%sveltekit.head%
</head>
<body>
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>- Single-page navigation is counted automatically. SvelteKit’s client-side routing uses the history API, which the script hooks.
- CSP: if you turn on SvelteKit’s CSP, add
nonce="%sveltekit.nonce%"to the script tag so the page’s policy allows it. Then allowhttps://in.nordtally.cominconnect-src, and inscript-srcfor browsers that ignore'strict-dynamic'.
Google Tag Manager
Add the tag as a Custom HTML tag that fires on every page. Google Tag Manager runs it after the container has loaded, so it is not a direct head tag.
- In the container, go to Tags, then New.
- Under Tag Configuration, choose Custom HTML.
- Paste the tag into the HTML field.
- Under Triggering, choose the All Pages trigger, then save and publish the container.
<script defer data-site="YOUR_SITE_ID" src="https://in.nordtally.com/s.js"></script>GTM’s limits, honestly:
- The tag runs only after the container has loaded and the trigger has fired. A visitor who leaves before that isn’t counted. A plain script tag in the head doesn’t have this gap.
- Google’s guidance is to use built-in tag templates where you can, because custom HTML tags are harder to audit for performance and security. Nordtally has no GTM template, so a Custom HTML tag is the way to add it.
- Your consent banner may block the GTM container, and with it this tag. The consent bridge is a second tag on the same trigger. The two can load in either order, since the tracker waits up to 3 seconds for the bridge before the first pageview.
- Ad blockers and filter lists can block GTM and
in.nordtally.comseparately. The first-party proxy avoids the second block. - Single-page routes are counted automatically, since the tag runs on every page and the script hooks the history API.
- CSP: GTM is itself a script on your page, so your policy already allows it. Add
https://in.nordtally.comtoscript-srcandconnect-srcas above.
Check it works
Load the site in a browser and open its page, then check the install page in the dashboard. The Verify installation card waits for the first pageview, then shows the time it arrived.
- The install page is in the dashboard under your site. It shows the snippet and the verification card.
- Open the Realtime view for the site. Your visit appears there within a few seconds.
- If nothing arrives, check the browser’s network tab for a request to
in.nordtally.com. A blocked request usually means an ad blocker or a CSP rule. - On localhost the script counts nothing unless you add
data-dev, which is useful for testing before you go live.
If the page is blocked by your own Content-Security-Policy, the browser console shows a violation naming the blocked URL. Allow https://in.nordtally.com as described for your platform above.