How to add analytics to a Notion website, and when you can't
A site Notion publishes itself takes no script tag. You get Notion's page view counts and, on a paid plan, a Google Analytics field. Any other tool needs a builder with a custom code field, and on some builders that field comes with a paid plan.
In this article
- 1Which kind of Notion site do you have?
- 2What Notion already counts
- 3Why a Notion Site takes no script tag
- 4Three ways to use another tool
- 5Find the builder's code field
- 6Add the tag to the site-wide head
- 7Test on the live site
- 8One site, several addresses
- 9If the numbers look wrong
- 10Does the site still need a cookie banner?
- 11The short version
Where an analytics script can go on a Notion website depends on who serves the pages. A site Notion publishes itself has no field for one: you get Notion's own view counts and, on a paid plan, a box for a Google Analytics ID. A site served by a Notion site builder usually has a custom code field, and from there it works like any other site.
This guide covers how to tell which one you have, what Notion already counts, the routes that work for another tool, where the tag goes in two builders and how to test it. The steps work for any analytics tool that installs with a script tag. The Notion details come from its help center, as of November 2026.
Which kind of Notion site do you have?
Three setups are common, and each one hands the HTML to someone different:
| Setup | Who serves the pages | Where analytics can go |
|---|---|---|
| Published with Notion Sites | Notion, on a notion.site address or on your own domain through Notion's custom domain add-on | Notion's page analytics, and a Google Analytics measurement ID on a paid plan |
| A Notion site builder | The builder, such as Super or Simple.ink, on its own subdomain or on your domain | The builder's custom code field, if your plan has one |
| A reverse proxy | A worker you run on your own domain, in front of a notion.site page | Whatever the worker adds to each page |
If you publish from Share → Publish inside Notion, it's the first. If you manage the site in a separate dashboard, it's the second. A page shared with Notion's Anyone on the web with link setting is something else again: Notion's help page on publishing says it's different from publishing a Notion Site, and the Site settings below belong to published Sites.
What Notion already counts
Notion has two ways to count visits without a script of your own:
Page analytics
Owners and editors of a page can open ••• → Updates & analytics, then the Analytics tab, and hover over a day to see total views and unique views, according to Notion's help page. Notion's guide to analytics adds that when a page is shared to the web, views from the web count too, and that the list of viewers leaves out anonymous visitors. The count also covers views from inside your workspace, your own included, unless you set My view history to Don't record under Settings in that Analytics tab.
The Google Analytics field
On a paid plan, open Share on the published page, then Publish → Site customization, select Google Analytics, enter your measurement ID and select Publish changes. Those are the steps on Notion's help page on customizing Sites, and it's the one analytics integration Notion's help describes for them. Google Analytics sets first-party cookies, which brings back the question of a cookie banner.
Sources are often the reason to look further. Visits from ChatGPT and similar assistants can carry the assistant as the referrer or a tag such as utm_source=chatgpt.com, and the guide to tracking ChatGPT traffic shows how to find them, whichever tool you use.
Why a Notion Site takes no script tag
Notion's help page on customizing Sites lists what a paid plan can change: share previews, a theme, the favicon, the header and its navigation, the page title and description, and the Google Analytics connection. A field for your own code isn't on that list. A custom domain through Notion's add-on, for workspace owners on a paid plan at $10 a month per domain or $8 a month with annual billing as of November 2026, changes the address and lets you remove the Notion watermark. Notion's help doesn't describe it adding a code field either.
Two kinds of block look like a way around this. Neither is:
- A code block displays code. Notion describes it as a way to show code, formatted by language. Nothing in it runs on the page.
- An embed block takes a link, not a tag. Notion's help on embeds says the link should start with
https, not<iframe, and that the content is shown through a service called Iframely. Whatever runs inside an embed runs in a frame of its own, so a tracking page embedded there would report the embed's address rather than your page's, wouldn't see where the visitor came from, and would only count pages that carry the embed.
A Notion Site takes a Google Analytics ID. It doesn't take a script tag.
Three ways to use another tool
If you want a different tool, the pages have to reach visitors some other way:
A Notion site builder
A builder reads your Notion pages and serves them as a site of its own, so it controls the HTML and can offer a custom code field. It's the route the rest of this guide follows.
Embed the page in a site you already track
Notion's publish settings have an Embed this page option that gives you code to paste into another website. Your tool then counts the page around the embed. Clicks between Notion pages inside it happen in a frame your script can't see, and the Notion address stays public as well.
A reverse proxy
A worker on your own domain, such as a Cloudflare Worker, fetches the notion.site page and adds your code on the way through. NoteHost is an open-source project that does this, with custom JavaScript for the head among its features. Its last code change was in July 2024. A proxy depends on how Notion builds its pages, Notion's help doesn't cover it, and when it breaks, fixing it is up to you.
Find the builder's code field
Each builder puts its code field in its own place, and some only open it on a paid plan. Two of them, as of November 2026:
Super
Super's pricing page puts custom code on the Personal plan and up, at $16 per site a month, or $144 per site a year on annual billing. The free plan, which runs on a super.site address, doesn't have it. Super's docs put the site-wide field in the site editor (the cog icon) under Code, with Head, Body and CSS tabs, and name Head as the tab for analytics scripts. Each page in Pages has a code icon for code that only runs there. Super also sells its own analytics as a paid add-on, billed by monthly page views, and says it uses no cookies.
Simple.ink
Its guide to custom code says to open your websites, pick the site and choose Custom code in the menu on the left, which has one box for your code. Its pricing page lists custom code on every plan, the free one included, while connecting your own domain starts on a paid plan. Without one, the site runs on a simple.ink address.
For another builder, look in its site settings for Custom code, Code injection or Head, and check its pricing page for which plan includes it.
Add the tag to the site-wide head
Sign up for the tool you picked, add your site using the address visitors will actually see, and copy the snippet it gives you, usually a single <script> tag shaped roughly like this:
<script defer src="https://analytics.example.com/script.js" data-site="YOUR-SITE-ID"></script>That's a placeholder, not a working tag. Copy the exact one from your tool's dashboard rather than from an email or a document, where straight quotes can turn into curly ones and quietly break it. Then, in the builder:
- Open the site's code settings, the ones that apply to every page.
- Paste the tag into the head field, or into the one code box on a builder like Simple.ink, on a line of its own and outside any other script. Where there's a separate body field, use it only if your tool's instructions ask for it.
- Save, and publish if the builder asks you to. On Super with manual publishing switched on, code changes show in the dashboard preview and on the site's
super.siteaddress, but stay off your own domain until you push them. - Leave the page-level code fields alone. Code there only runs on that page, and the same tag in both places loads twice on it.
Test on the live site
Do this on the live site, not in the builder's preview:
- Open the site in a private window, on the address you registered with your tool, with any ad or tracker blocker turned off for the test.
- View the page source and search for the script's address. If it isn't there, check that you saved and published, that the tag went into the site-wide field, and that your plan includes custom code.
- Open the developer tools, go to the Network tab and reload. Filter by your tool's domain. You should see the script load, and usually a second request that sends the pageview.
- Open the tool's live or real-time view, if it has one, and look for your visit.
- Click through three or four pages using the site's own links. A builder may switch pages without loading a new document, and a script that only counts full page loads records the first page of each visit and nothing after it. If only the first page shows up, look in your tool's docs for its single-page app setting.
One site, several addresses
A Notion website often answers on more than one address, and a script only sees visits to the pages it's loaded on:
- The builder's own address. Without your own domain, Super's sites run on
super.siteand Simple.ink's onsimple.ink. After you connect a domain, open the old address. If it still loads, visits there end up in your numbers if the tool counts every hostname, and nowhere if it only counts your domain. Share one address everywhere, and redirect the other if the builder lets you. - The Notion page itself. Super's help asks for a site's Notion pages to be public, and Simple.ink's pricing page says the Notion page has to be shared publicly unless you use manual publishing on its Pro plan. A public Notion page, or a Notion Site you published before moving to a builder, opens on Notion's address too, where your script never runs. Check the builder's docs before you unpublish anything, since some need the page public.
If the numbers look wrong
- Nothing in the page source. The change wasn't saved or published, the tag went into one page's code field, or the plan doesn't include custom code.
- In the source, but nothing loads. A blocker stopped it, or the tag broke on the way: curly quotes, a missing
</script>, or the tag pasted inside another tag. - The script loads, but no visits appear. The tool expects one address and you tested on another, such as the builder's subdomain when you registered your own domain.
- Every visit is one page long. The script isn't seeing page changes, and your bounce rate will look far worse than it is. Run the click-through test above.
- Everything counted twice. The tag is in the site-wide field and in a page's own code field. Remove one.
- Notion's page analytics shows more. It counts views inside your workspace and on Notion's own address, and your tool counts neither. Check that both rise and fall on the same days, and read why no two analytics tools agree on your traffic for the rest of the gap.
- A lot of Direct. Plenty of real visits arrive without a referrer. There's a separate article on what hides in it.
Does the site still need a cookie banner?
A cookie-free analytics script removes one reason for a banner. The rest of the site can still add others. Google Analytics' tag sets two first-party cookies, _ga and _ga_<container-id>, kept for two years by default, and more once the property is linked to Google Ads, according to Google's help page, whether it arrives through Notion's field or a builder's code field. Embeds, chat widgets and fonts can bring their own, and so can the platform serving the pages. To see what your published site stores, open the developer tools, clear the site data, browse a few pages and look under Cookies and Local storage. Whether you can drop the banner depends on that whole list, and what it takes to run a website without a cookie banner goes through it.
If you plan to share the site's links in newsletters or posts, tag them the same way from the first day. A small UTM naming system keeps those reports readable.
The short version
- Find out who serves the pages: Notion, a builder or a proxy.
- On Notion Sites, use page analytics or the Google Analytics field.
- For another tool, use a builder whose plan includes custom code.
- Paste the tag in the site-wide head field, not in a page's own field.
- Test on the live address by clicking through several pages.
- Know which other addresses still show the site.
Lomen is one of the tools you could add through a builder, as one script tag in its site-wide code field, with no API key, package or build step. It can't go on a site Notion publishes itself, any more than another tool's tag can. It counts page changes that happen without a reload, and a second copy of the tag for the same site does nothing, so a duplicate in a page's own code field can't double the count. Pageviews only count from the domain you added and its subdomains, so with your own domain added, visits to the builder's address stay out of the numbers. Its standard script sets no cookies, Lomen never stores IP addresses, and by default the script keeps nothing in the visitor's browser. Lomen groups visits from nine AI assistants by referrer and utm_source, and Lomen AI, a chat in the dashboard, answers questions about your own figures. It has no custom events or funnels. Lomen is free during the public beta.