Skip to content

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, replaceState and popstate. Only hash-based routers need data-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.

  1. Open your site in the Webflow Designer and go to Site settings.
  2. Open the Custom code tab.
  3. Paste the tag into Head code and click Save changes.
  4. Publish the site. Custom code only appears on the published site.
Head code
<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.com in script-src and connect-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.

  1. In the Squarespace admin, open Settings, then Advanced, then Code Injection.
  2. Paste the tag into the Header box and save.
Header
<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.com in script-src and connect-src.

Source: Squarespace help, adding code to the header or footer.

Wix

Add the tag as a custom code snippet placed in the Head.

  1. In your site’s dashboard, go to Settings.
  2. Under Development and integrations, click Custom Code.
  3. Click + Add Custom Code and paste the tag into the text box.
  4. Give the code a name, such as Nordtally.
  5. 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.
  6. Under Place Code in, choose Head.
  7. Click Apply and publish the site.
Custom Code, placed in Head
<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.com in script-src and connect-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.

  1. In the Ghost admin, go to Settings, then Advanced, then Code Injection.
  2. Paste the tag into Site Header and save.
Site Header
<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.com in script-src and connect-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.

  1. Open the project and go to Site Settings.
  2. Find the Custom Code section.
  3. Paste the tag into the head section (Framer offers the start or end of the head and body) and save.
  4. Publish the site, then open the live page to check it.
Custom Code, head
<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.com in script-src and connect-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.

  1. 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.
  2. Paste the tag just before </head>, then save.
header.php
<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.com in script-src and connect-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> in layouts/_default/baseof.html, or in the partial it includes, such as layouts/partials/head.html.
  • Jekyll: the <head> in _layouts/default.html.
  • Eleventy: the <head> in your base layout, for example _includes/base.njk.
base layout, inside <head>
<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.com in script-src and connect-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.

app/layout.tsx
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. Use beforeInteractive only if you need the script to run before any Next.js code.
  • Extra attributes such as data-outbound pass through to the script element. For the pinned tag from the install page, copy its integrity and crossorigin values onto the same Script.
  • Consented mode: add a second Script with src="https://in.nordtally.com/s.consent.js" and the same nonce.
  • Nonce-based CSP: next/script doesn’t add a nonce to your own Script tags unless you pass one. Read it from the x-nonce header set by your proxy, as above. Calling headers() 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. Add https://in.nordtally.com to connect-src so the events can be sent. Older browsers ignore 'strict-dynamic' and need the host in script-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.

nuxt.config.ts
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.com in script-src and connect-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.

src/layouts/Base.astro
---
---
<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.com in script-src and connect-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.

src/app.html
<!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 allow https://in.nordtally.com in connect-src, and in script-src for 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.

  1. In the container, go to Tags, then New.
  2. Under Tag Configuration, choose Custom HTML.
  3. Paste the tag into the HTML field.
  4. Under Triggering, choose the All Pages trigger, then save and publish the container.
Custom HTML tag
<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.com separately. 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.com to script-src and connect-src as 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.