From 92a0f5848f49413759798d227af900ca5d7273bf Mon Sep 17 00:00:00 2001 From: Conductor Adriaan Date: Fri, 6 Nov 2026 07:16:36 +0000 Subject: [PATCH 1/6] Add an install guide for AI agents docs.simpleanalytics.com/install.md explains how to add the script with data-hostname, lists every platform, framework and plugin, and how to check that it works. The script page offers installing with AI first, and recommends data-hostname for testing on localhost. Co-Authored-By: Claude Opus 5.5 --- _docs/20_install-script/01_script.md | 19 +++++++- _docs/20_install-script/04_install.md | 27 ++--------- _includes/install-frameworks.md | 17 +++++++ _includes/install-platforms.md | 14 ++++++ install.txt | 67 +++++++++++++++++++++++++++ 5 files changed, 118 insertions(+), 26 deletions(-) create mode 100644 _includes/install-frameworks.md create mode 100644 _includes/install-platforms.md create mode 100644 install.txt diff --git a/_docs/20_install-script/01_script.md b/_docs/20_install-script/01_script.md index c6e7b7a5..ef7ed5ef 100644 --- a/_docs/20_install-script/01_script.md +++ b/_docs/20_install-script/01_script.md @@ -2,9 +2,19 @@ title: How to add our script category: install-script permalink: /script -last_modified_at: 2026-10-29 +last_modified_at: 2026-11-06 --- +## Install with AI + +Using Claude Code, Codex, Cursor or another AI agent? Let it install the script and check that it works. When you add a website in the dashboard, click **Copy AI instructions** and paste them into your agent. They have the right script for your website and let the agent check the installation. Or ask your agent: + +``` +Install Simple Analytics on example.com, follow https://docs.simpleanalytics.com/install.md +``` + +## Install manually + Include these two lines on every page at the end of your `` (or anywhere else): @@ -36,7 +46,12 @@ With Simple Analytics you don't need to manually trigger page views in SPA. We a Some people like a very light script. All our scripts are heavily compressed and we have [an extra light](/light) version. -If you want to run the script on localhost, please use our dev (`https://scripts.simpleanalyticscdn.com/latest.dev.js`) version. Note the `.dev` part. You might want to [overwrite your hostname](/overwrite-domain-name) from localhost to something like `dev.example.com` (where `example.com` is your domain) to receive it in your dashboard. Make sure to remove the `.dev` part from the script on production. +To test the script on localhost or a preview URL, set `data-hostname` to the hostname of your website. Page views there then count for that website, so you can check the requests before your website is live. See [overwrite domain name](/overwrite-domain-name). + + +```html + +``` We drop data from some shared preview and proxy domains, like `*.vercel.app`, `*.lovable.app`, and `*.translate.goog`, unless that exact hostname is added to your dashboard. To collect data on such a domain, add the hostname to your dashboard or [overwrite the hostname](/overwrite-domain-name). diff --git a/_docs/20_install-script/04_install.md b/_docs/20_install-script/04_install.md index 1a8ff46b..a6f063c5 100644 --- a/_docs/20_install-script/04_install.md +++ b/_docs/20_install-script/04_install.md @@ -3,7 +3,7 @@ title: Install Simple Analytics on other platforms menu: Install on other platforms category: install-script permalink: /install-on-other-platforms -last_modified_at: 2026-10-17 +last_modified_at: 2026-11-06 --- ## Platform guides @@ -12,16 +12,7 @@ We try to make installing Simple Analytics as simple as possible. We want privac Read our guides on how to install Simple Analytics on: -- [Google Tag Manager](/install-simple-analytics-with-google-tag-manager) (source on [GitHub](https://github.com/simpleanalytics/google-tag-manager#readme)) -- [Wordpress](/install-simple-analytics-on-wordpress) (source on [GitHub](https://github.com/simpleanalytics/wordpress-plugin#readme)) -- [Ghost](/install-simple-analytics-on-ghost) -- [WIX](/install-simple-analytics-on-wix) -- [Squarespace](/install-simple-analytics-on-squarespace) -- [Webflow](/install-simple-analytics-on-webflow) -- [Jimdo Creator](/install-simple-analytics-on-jimdo-creator) -- [MailerLite](/install-simple-analytics-on-mailerlite) -- [GoDaddy](/install-simple-analytics-on-godaddy) -- [Netlify](https://app.netlify.com/extensions/simpleanalytics) +{% include install-platforms.md %} Cloudflare has deprecated Cloudflare Apps, so you can no longer install our [Cloudflare App](/install-simple-analytics-on-cloudflare). Add [our script](/script) to your website instead. @@ -36,18 +27,6 @@ For most frameworks, you can include the script. We magically track page views, Get our official plugins for these frameworks: -- [React](/install-simple-analytics-with-react) (package on [npm](https://www.npmjs.com/package/@simpleanalytics/react)) -- [Ruby on Rails](/install-simple-analytics-with-ruby-on-rails) (source on [GitHub](https://github.com/simpleanalytics/rubyonrails-plugin#readme)) -- [Gatsby](/install-simple-analytics-with-gatsby) (source on [GitHub](https://github.com/simpleanalytics/gatsby-plugin#readme)) -- [Vue](/install-simple-analytics-with-vue) (source on [GitHub](https://github.com/simpleanalytics/vue-plugin#readme)) -- [VuePress](/install-simple-analytics-with-vuepress) (source on [GitHub](https://github.com/simpleanalytics/vuepress-plugin#readme)) -- [Nuxt.js](/install-simple-analytics-with-nuxt) (package on [npm](https://www.npmjs.com/package/@simpleanalytics/nuxt)) -- [Gridsome](/install-simple-analytics-with-gridsome) (source on [GitHub](https://github.com/simpleanalytics/gridsome-plugin#readme)) -- [Django](/install-simple-analytics-with-django) (source on [GitHub](https://github.com/simpleanalytics/django-plugin#readme)) -- [Analytics library](/install-simple-analytics-via-analytics-package) (source on [GitHub](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-simple-analytics)) -- [Hugo](/install-simple-analytics-with-hugo) (guide only) -- [Next.js](/install-simple-analytics-with-next) (package on [npm](https://www.npmjs.com/package/@simpleanalytics/next)) -- [Docusaurus](/install-simple-analytics-with-docusaurus) (source on [GitHub](https://github.com/simpleanalytics/docusaurus-plugin#readme)) -- [Astro](https://github.com/simpleanalytics/astro-plugin) (guide on GitHub) +{% include install-frameworks.md %} > Are you missing your favorite framework? [Let us know!](https://simpleanalytics.com/contact) Happy to create a plugin for you. diff --git a/_includes/install-frameworks.md b/_includes/install-frameworks.md new file mode 100644 index 00000000..ec215364 --- /dev/null +++ b/_includes/install-frameworks.md @@ -0,0 +1,17 @@ +- [React]({{ site.url }}/install-simple-analytics-with-react) (package on [npm](https://www.npmjs.com/package/@simpleanalytics/react)) +- [Next.js]({{ site.url }}/install-simple-analytics-with-next) (package on [npm](https://www.npmjs.com/package/@simpleanalytics/next)) +- [Vue]({{ site.url }}/install-simple-analytics-with-vue) (source on [GitHub](https://github.com/simpleanalytics/vue-plugin#readme)) +- [Nuxt.js]({{ site.url }}/install-simple-analytics-with-nuxt) (package on [npm](https://www.npmjs.com/package/@simpleanalytics/nuxt)) +- [VuePress]({{ site.url }}/install-simple-analytics-with-vuepress) (source on [GitHub](https://github.com/simpleanalytics/vuepress-plugin#readme)) +- [Gatsby]({{ site.url }}/install-simple-analytics-with-gatsby) (source on [GitHub](https://github.com/simpleanalytics/gatsby-plugin#readme)) +- [Gridsome]({{ site.url }}/install-simple-analytics-with-gridsome) (source on [GitHub](https://github.com/simpleanalytics/gridsome-plugin#readme)) +- [Astro](https://github.com/simpleanalytics/astro-plugin) (guide on GitHub) +- [Docusaurus]({{ site.url }}/install-simple-analytics-with-docusaurus) (source on [GitHub](https://github.com/simpleanalytics/docusaurus-plugin#readme)) +- [Hugo]({{ site.url }}/install-simple-analytics-with-hugo) (guide only) +- Jekyll (add the script to `_layouts/default.html`, just before ``) +- Vite (add the script to `index.html`, or add it with the [`transformIndexHtml`](https://vite.dev/guide/api-plugin.html#transformindexhtml) plugin hook) +- [Ruby on Rails]({{ site.url }}/install-simple-analytics-with-ruby-on-rails) (source on [GitHub](https://github.com/simpleanalytics/rubyonrails-plugin#readme)) +- [Django]({{ site.url }}/install-simple-analytics-with-django) (source on [GitHub](https://github.com/simpleanalytics/django-plugin#readme)) +- [Laravel](https://github.com/simpleanalytics/laravel-package#readme) (package on [Packagist](https://packagist.org/packages/simpleanalytics/laravel-package)) +- [Drupal](https://github.com/simpleanalytics/drupal-module#readme) (source on GitHub) +- [Analytics library]({{ site.url }}/install-simple-analytics-via-analytics-package) (source on [GitHub](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-simple-analytics)) diff --git a/_includes/install-platforms.md b/_includes/install-platforms.md new file mode 100644 index 00000000..9522ba8e --- /dev/null +++ b/_includes/install-platforms.md @@ -0,0 +1,14 @@ +- [Google Tag Manager]({{ site.url }}/install-simple-analytics-with-google-tag-manager) (source on [GitHub](https://github.com/simpleanalytics/google-tag-manager#readme)) +- [WordPress]({{ site.url }}/install-simple-analytics-on-wordpress) (source on [GitHub](https://github.com/simpleanalytics/wordpress-plugin#readme)) +- [Ghost]({{ site.url }}/install-simple-analytics-on-ghost) +- [WIX]({{ site.url }}/install-simple-analytics-on-wix) +- [Squarespace]({{ site.url }}/install-simple-analytics-on-squarespace) +- [Webflow]({{ site.url }}/install-simple-analytics-on-webflow) +- [Jimdo Creator]({{ site.url }}/install-simple-analytics-on-jimdo-creator) +- [MailerLite]({{ site.url }}/install-simple-analytics-on-mailerlite) +- [GoDaddy]({{ site.url }}/install-simple-analytics-on-godaddy) +- [Netlify](https://app.netlify.com/extensions/simpleanalytics) (turn it on per site, only for sites with a build step) +- [Buttondown](https://buttondown.com/settings/integrations) (turn on Simple Analytics under Integrations) +- GitHub Pages (add the script to the main template, like `_layouts/default.html` for Jekyll) +- Google Sites (Insert, Embed, Embed code, with `data-hostname` set to a domain you added, because you can't add `sites.google.com`) +- NodeBB (drag an HTML widget with the script into the Global Footer, under Extend and Widgets) diff --git a/install.txt b/install.txt new file mode 100644 index 00000000..7fb13767 --- /dev/null +++ b/install.txt @@ -0,0 +1,67 @@ +--- +layout: null +permalink: /install.md +sitemap: false +--- +# Install Simple Analytics + +How to add Simple Analytics, privacy-first analytics, to a website and check that it works. Written for AI agents, like Claude Code, Codex and Cursor, and for developers. + +Came here from the Simple Analytics dashboard or its MCP tools? They gave you the hostname and the script for the website, use those. + +## 1. Add the script + +Add the script to every page, for example just before ``. Replace `example.com` with the hostname of the website, as it's added in Simple Analytics: + +```html + + +``` + +Always set `data-hostname`. Page views on localhost and on preview or staging URLs then count for the website, so you can test the script before the website is live. See [overwrite domain name]({{ site.url }}/overwrite-domain-name). + +Does the website use a [custom domain]({{ site.url }}/bypass-ad-blockers) for Simple Analytics? Load the script from that domain instead: `https:///latest.js`. + +Use the guide or plugin for the platform or framework of the website, with the same hostname. Single-page apps don't need extra code, the script tracks page views when the URL changes. Is the platform not listed? Add the script to the template or layout every page uses. + +Hosted platforms: + +{% include install-platforms.md %} + +Frameworks: + +{% include install-frameworks.md %} + +All script settings, like `data-collect-dnt="true"`, are on [the script page]({{ site.url }}/script). + +## 2. Content Security Policy + +Does the website have a Content Security Policy? Allow Simple Analytics in it: + +``` +script-src https://scripts.simpleanalyticscdn.com; +connect-src https://queue.simpleanalyticscdn.com; +img-src https://queue.simpleanalyticscdn.com; +``` + +With a custom domain, allow that domain instead of both. See [Content Security Policy]({{ site.url }}/csp). + +## 3. Check that it works + +1. Open a page with the script in a browser and find the `simple.gif` request, in DevTools or with the Chrome DevTools Protocol. Its `simple-analytics-feedback` response header says: + - `Thanks for sending this page view!`, `Thanks for sending this event!` or `Thanks for sending this additional data!` (sent when leaving a page): it works. + - `Website not registered in Simple Analytics, dropping request`: the hostname that was sent isn't added to Simple Analytics, check `data-hostname`. + - `IP in excluded IP list for website`: the website settings exclude this IP address. + - Anything else explains what is wrong. +2. No `simple.gif` request? Check the console for `Simple Analytics:` warnings and Content Security Policy errors. +3. Never replay the `simple.gif` request with curl or other tools, it adds fake page views. + +JavaScript on the page can't read this header. Server-side page views, like `trackPageview` in Next.js middleware, don't show up in the browser at all. + +With access to Simple Analytics, through its MCP tools or a token the user approved, `check_installation` checks the live website and `get_recent_hits` shows the latest page views and events. + +Headless browsers, like the ones AI agents use, count as robots. Simple Analytics stores robots but doesn't show them in the dashboard, so a test visit by an agent only shows up in the recent hits, marked as a robot. + +If the recent hits show nothing, that doesn't mean the installation failed. A page view that got `Thanks for sending this page view!` is almost always stored, also when the website isn't added yet. Hits of new websites can take over an hour to show up. + +Need help? See [our support channels](https://simpleanalytics.com/contact). From 29edd2210b646704d791b9d2c316d6d5911cac11 Mon Sep 17 00:00:00 2001 From: Conductor Adriaan Date: Fri, 6 Nov 2026 07:42:29 +0000 Subject: [PATCH 2/6] List Framer and the Google Sites limits in the install guides Co-Authored-By: Claude Opus 5.5 --- _includes/install-platforms.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_includes/install-platforms.md b/_includes/install-platforms.md index 9522ba8e..310217a6 100644 --- a/_includes/install-platforms.md +++ b/_includes/install-platforms.md @@ -4,11 +4,12 @@ - [WIX]({{ site.url }}/install-simple-analytics-on-wix) - [Squarespace]({{ site.url }}/install-simple-analytics-on-squarespace) - [Webflow]({{ site.url }}/install-simple-analytics-on-webflow) +- [Framer](https://www.framer.com/marketplace/plugins/simple-analytics/) (plugin on the Framer Marketplace) - [Jimdo Creator]({{ site.url }}/install-simple-analytics-on-jimdo-creator) - [MailerLite]({{ site.url }}/install-simple-analytics-on-mailerlite) - [GoDaddy]({{ site.url }}/install-simple-analytics-on-godaddy) - [Netlify](https://app.netlify.com/extensions/simpleanalytics) (turn it on per site, only for sites with a build step) - [Buttondown](https://buttondown.com/settings/integrations) (turn on Simple Analytics under Integrations) - GitHub Pages (add the script to the main template, like `_layouts/default.html` for Jekyll) -- Google Sites (Insert, Embed, Embed code, with `data-hostname` set to a domain you added, because you can't add `sites.google.com`) +- Google Sites (limited: it runs the script in a sandbox, so page paths, referrers and UTM codes aren't tracked. Insert, Embed, Embed code, with `data-path="/"` and `data-hostname` set to a domain you added, because you can't add `sites.google.com`) - NodeBB (drag an HTML widget with the script into the Global Footer, under Extend and Widgets) From 39e82a7c3c0e1262f3950a19ea60e31c7a64867e Mon Sep 17 00:00:00 2001 From: Conductor Adriaan Date: Fri, 6 Nov 2026 08:03:57 +0000 Subject: [PATCH 3/6] Cover hash routing, script-src-elem and the Free plan badge Also check the page view response on its own, and point Google Sites to the path overwriter, since the script has no data-path setting. Co-Authored-By: Claude Opus 5.5 --- _includes/install-platforms.md | 2 +- install.txt | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/_includes/install-platforms.md b/_includes/install-platforms.md index 310217a6..b1b6e92c 100644 --- a/_includes/install-platforms.md +++ b/_includes/install-platforms.md @@ -11,5 +11,5 @@ - [Netlify](https://app.netlify.com/extensions/simpleanalytics) (turn it on per site, only for sites with a build step) - [Buttondown](https://buttondown.com/settings/integrations) (turn on Simple Analytics under Integrations) - GitHub Pages (add the script to the main template, like `_layouts/default.html` for Jekyll) -- Google Sites (limited: it runs the script in a sandbox, so page paths, referrers and UTM codes aren't tracked. Insert, Embed, Embed code, with `data-path="/"` and `data-hostname` set to a domain you added, because you can't add `sites.google.com`) +- Google Sites (limited: it runs the script in a sandbox, so page paths, referrers and UTM codes aren't tracked. Insert, Embed, Embed code, with `data-hostname` set to a domain you added, because you can't add `sites.google.com`. To count every visit as `/`, [overwrite the path]({{ site.url }}/overwrite-path)) - NodeBB (drag an HTML widget with the script into the Global Footer, under Extend and Widgets) diff --git a/install.txt b/install.txt index 7fb13767..28d3c94f 100644 --- a/install.txt +++ b/install.txt @@ -22,7 +22,7 @@ Always set `data-hostname`. Page views on localhost and on preview or staging UR Does the website use a [custom domain]({{ site.url }}/bypass-ad-blockers) for Simple Analytics? Load the script from that domain instead: `https:///latest.js`. -Use the guide or plugin for the platform or framework of the website, with the same hostname. Single-page apps don't need extra code, the script tracks page views when the URL changes. Is the platform not listed? Add the script to the template or layout every page uses. +Use the guide or plugin for the platform or framework of the website, with the same hostname. Single-page apps don't need extra code, the script tracks page views when the URL changes. With hash routing (`/#/page`), add `data-mode="hash"`, see [hash mode]({{ site.url }}/hash-mode). Is the platform not listed? Add the script to the template or layout every page uses. Hosted platforms: @@ -34,9 +34,11 @@ Frameworks: All script settings, like `data-collect-dnt="true"`, are on [the script page]({{ site.url }}/script). +Is the website on the Free plan? It needs to show a [Simple Analytics badge]({{ site.url }}/free-plan-badge), in a footer on every page. Without it, we lock the dashboard data and API of the website after 14 days. + ## 2. Content Security Policy -Does the website have a Content Security Policy? Allow Simple Analytics in it: +Does the website have a Content Security Policy? Add Simple Analytics to the directives it already has, also to `script-src-elem` when the policy has it: ``` script-src https://scripts.simpleanalyticscdn.com; @@ -44,12 +46,13 @@ connect-src https://queue.simpleanalyticscdn.com; img-src https://queue.simpleanalyticscdn.com; ``` -With a custom domain, allow that domain instead of both. See [Content Security Policy]({{ site.url }}/csp). +With a custom domain, allow that domain instead of both. The Free plan badge also needs `img-src https://simpleanalyticsbadges.com`. See [Content Security Policy]({{ site.url }}/csp). ## 3. Check that it works 1. Open a page with the script in a browser and find the `simple.gif` request, in DevTools or with the Chrome DevTools Protocol. Its `simple-analytics-feedback` response header says: - - `Thanks for sending this page view!`, `Thanks for sending this event!` or `Thanks for sending this additional data!` (sent when leaving a page): it works. + - `Thanks for sending this page view!`: page views work. + - `Thanks for sending this event!` or `Thanks for sending this additional data!` (sent when leaving a page): that request works, but also check the page view request. - `Website not registered in Simple Analytics, dropping request`: the hostname that was sent isn't added to Simple Analytics, check `data-hostname`. - `IP in excluded IP list for website`: the website settings exclude this IP address. - Anything else explains what is wrong. From d50e4307b2be222e0f7bc612fad3e08513203777 Mon Sep 17 00:00:00 2001 From: Conductor Adriaan Date: Sat, 7 Nov 2026 14:01:03 +0000 Subject: [PATCH 4/6] Explain URL parameters, personal data, proxies and the metrics to agents Co-Authored-By: Claude Opus 5.5 --- install.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install.txt b/install.txt index 28d3c94f..f5b9bfc3 100644 --- a/install.txt +++ b/install.txt @@ -67,4 +67,15 @@ Headless browsers, like the ones AI agents use, count as robots. Simple Analytic If the recent hits show nothing, that doesn't mean the installation failed. A page view that got `Thanks for sending this page view!` is almost always stored, also when the website isn't added yet. Hits of new websites can take over an hour to show up. +## 4. Collect the right data + +- **URL parameters:** we only keep UTM codes and `ref`. To collect another parameter, like `product-id`, add it to [`data-allow-params`]({{ site.url }}/allow-params) first. It's only collected from then on. +- **No personal data:** never put email addresses, names, user IDs or other personal data in paths, URL parameters, [events]({{ site.url }}/events) or [metadata]({{ site.url }}/metadata). It's not allowed, and the account might be suspended. +- **Missing data,** for example because of ad blockers? Set up a [custom domain]({{ site.url }}/bypass-ad-blockers), or even better the [proxy]({{ site.url }}/proxy). + +## How the data works + +- **Visitors are [unique pageviews]({{ site.url }}/explained/unique-visits),** not people. A page view is unique when it has no referrer or comes from another website. We use no cookies or identifiers, so websites need no cookie banner. +- **Each step of a [goal]({{ site.url }}/goals) counts the matching data on its own.** Visitors don't have to go through the earlier steps, so a later step can be higher than an earlier one. + Need help? See [our support channels](https://simpleanalytics.com/contact). From c9a35c59f8e419158ab24aa35624e1ae28e27b75 Mon Sep 17 00:00:00 2001 From: Conductor Adriaan Date: Sat, 7 Nov 2026 14:22:16 +0000 Subject: [PATCH 5/6] Prefer plugins over the script tag and cover theme gems and strict CSPs Also add Google Sites embeds to every page, and say the cookie banner point is about Simple Analytics only. Co-Authored-By: Claude Opus 5.5 --- _includes/install-frameworks.md | 2 +- _includes/install-platforms.md | 4 ++-- install.txt | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/_includes/install-frameworks.md b/_includes/install-frameworks.md index ec215364..7cbf01e2 100644 --- a/_includes/install-frameworks.md +++ b/_includes/install-frameworks.md @@ -8,7 +8,7 @@ - [Astro](https://github.com/simpleanalytics/astro-plugin) (guide on GitHub) - [Docusaurus]({{ site.url }}/install-simple-analytics-with-docusaurus) (source on [GitHub](https://github.com/simpleanalytics/docusaurus-plugin#readme)) - [Hugo]({{ site.url }}/install-simple-analytics-with-hugo) (guide only) -- Jekyll (add the script to `_layouts/default.html`, just before ``) +- Jekyll (add the script to the base layout, usually `_layouts/default.html`, just before ``. With a theme gem, copy the theme's layout into `_layouts/` first) - Vite (add the script to `index.html`, or add it with the [`transformIndexHtml`](https://vite.dev/guide/api-plugin.html#transformindexhtml) plugin hook) - [Ruby on Rails]({{ site.url }}/install-simple-analytics-with-ruby-on-rails) (source on [GitHub](https://github.com/simpleanalytics/rubyonrails-plugin#readme)) - [Django]({{ site.url }}/install-simple-analytics-with-django) (source on [GitHub](https://github.com/simpleanalytics/django-plugin#readme)) diff --git a/_includes/install-platforms.md b/_includes/install-platforms.md index b1b6e92c..931df827 100644 --- a/_includes/install-platforms.md +++ b/_includes/install-platforms.md @@ -10,6 +10,6 @@ - [GoDaddy]({{ site.url }}/install-simple-analytics-on-godaddy) - [Netlify](https://app.netlify.com/extensions/simpleanalytics) (turn it on per site, only for sites with a build step) - [Buttondown](https://buttondown.com/settings/integrations) (turn on Simple Analytics under Integrations) -- GitHub Pages (add the script to the main template, like `_layouts/default.html` for Jekyll) -- Google Sites (limited: it runs the script in a sandbox, so page paths, referrers and UTM codes aren't tracked. Insert, Embed, Embed code, with `data-hostname` set to a domain you added, because you can't add `sites.google.com`. To count every visit as `/`, [overwrite the path]({{ site.url }}/overwrite-path)) +- GitHub Pages (add the script to the main template, like `_layouts/default.html` for Jekyll, see Jekyll below) +- Google Sites (limited: it runs the script in a sandbox, so page paths, referrers and UTM codes aren't tracked. Add it to every page with Insert, Embed, Embed code, with `data-hostname` set to a domain you added, because you can't add `sites.google.com`. To count every visit as `/`, [overwrite the path]({{ site.url }}/overwrite-path)) - NodeBB (drag an HTML widget with the script into the Global Footer, under Extend and Widgets) diff --git a/install.txt b/install.txt index f5b9bfc3..39312db9 100644 --- a/install.txt +++ b/install.txt @@ -22,7 +22,7 @@ Always set `data-hostname`. Page views on localhost and on preview or staging UR Does the website use a [custom domain]({{ site.url }}/bypass-ad-blockers) for Simple Analytics? Load the script from that domain instead: `https:///latest.js`. -Use the guide or plugin for the platform or framework of the website, with the same hostname. Single-page apps don't need extra code, the script tracks page views when the URL changes. With hash routing (`/#/page`), add `data-mode="hash"`, see [hash mode]({{ site.url }}/hash-mode). Is the platform not listed? Add the script to the template or layout every page uses. +Has the platform or framework a guide or plugin below? Use it instead of the script tag above, with the same hostname, so the script isn't added twice. Single-page apps don't need extra code, the script tracks page views when the URL changes. With hash routing (`/#/page`), add `data-mode="hash"`, see [hash mode]({{ site.url }}/hash-mode). Is the platform not listed? Add the script to the template or layout every page uses. Hosted platforms: @@ -38,7 +38,7 @@ Is the website on the Free plan? It needs to show a [Simple Analytics badge]({{ ## 2. Content Security Policy -Does the website have a Content Security Policy? Add Simple Analytics to the directives it already has, also to `script-src-elem` when the policy has it: +Does the website have a Content Security Policy? Add Simple Analytics to the directives it already has, also to `script-src-elem` when the policy has it. With `'strict-dynamic'`, hosts are ignored, so give the script tag the policy's nonce instead: ``` script-src https://scripts.simpleanalyticscdn.com; @@ -75,7 +75,7 @@ If the recent hits show nothing, that doesn't mean the installation failed. A pa ## How the data works -- **Visitors are [unique pageviews]({{ site.url }}/explained/unique-visits),** not people. A page view is unique when it has no referrer or comes from another website. We use no cookies or identifiers, so websites need no cookie banner. +- **Visitors are [unique pageviews]({{ site.url }}/explained/unique-visits),** not people. A page view is unique when it has no referrer or comes from another website. Simple Analytics uses no cookies or identifiers, so it needs no cookie banner. Other tools on the website might. - **Each step of a [goal]({{ site.url }}/goals) counts the matching data on its own.** Visitors don't have to go through the earlier steps, so a later step can be higher than an earlier one. Need help? See [our support channels](https://simpleanalytics.com/contact). From f01fdef12ca96e90cf56c0293ad5981eb7aa54f7 Mon Sep 17 00:00:00 2001 From: Conductor Adriaan Date: Sat, 7 Nov 2026 14:29:53 +0000 Subject: [PATCH 6/6] Check every Google Sites page sends a page view Co-Authored-By: Claude Opus 5.5 --- _includes/install-platforms.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/install-platforms.md b/_includes/install-platforms.md index 931df827..8d094ad0 100644 --- a/_includes/install-platforms.md +++ b/_includes/install-platforms.md @@ -11,5 +11,5 @@ - [Netlify](https://app.netlify.com/extensions/simpleanalytics) (turn it on per site, only for sites with a build step) - [Buttondown](https://buttondown.com/settings/integrations) (turn on Simple Analytics under Integrations) - GitHub Pages (add the script to the main template, like `_layouts/default.html` for Jekyll, see Jekyll below) -- Google Sites (limited: it runs the script in a sandbox, so page paths, referrers and UTM codes aren't tracked. Add it to every page with Insert, Embed, Embed code, with `data-hostname` set to a domain you added, because you can't add `sites.google.com`. To count every visit as `/`, [overwrite the path]({{ site.url }}/overwrite-path)) +- Google Sites (limited: it runs the script in a sandbox, so page paths, referrers and UTM codes aren't tracked. Add it to every page with Insert, Embed, Embed code, with `data-hostname` set to a domain you added, because you can't add `sites.google.com`. Check each page sends a page view. To count every visit as `/`, [overwrite the path]({{ site.url }}/overwrite-path)) - NodeBB (drag an HTML widget with the script into the Global Footer, under Extend and Widgets)