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..7cbf01e2 --- /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 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)) +- [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..8d094ad0 --- /dev/null +++ b/_includes/install-platforms.md @@ -0,0 +1,15 @@ +- [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) +- [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, 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`. 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) diff --git a/install.txt b/install.txt new file mode 100644 index 00000000..39312db9 --- /dev/null +++ b/install.txt @@ -0,0 +1,81 @@ +--- +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 `