Fresh + Plausible
-
+
+
Welcome to `fresh`. Try update this message in the ./routes/index.tsx
diff --git a/docs/proxy/guides/netlify.md b/docs/proxy/guides/netlify.md
index 9d8e690f..fee6da62 100644
--- a/docs/proxy/guides/netlify.md
+++ b/docs/proxy/guides/netlify.md
@@ -2,49 +2,8 @@
title: Proxying Plausible through Netlify
---
+We've removed old proxying instructions due to being out of date. [See our general proxying guide](/proxy/introduction).
+
:::tip Don't want to manage your own proxy? We can handle it for you
Our managed proxy lets you send analytics through your own domain name as a first-party connection. All you need to do is set up a CNAME record using the instructions we'll send you and update the snippet on your site. We'll take care of everything else. [Contact us for details](https://plausible.io/contact).
:::
-
-## Step 1: Add URL rewrite rules
-
-If you don't already have a `_redirects` file at the publishing directory of your site, create one. You can learn more about Netlify redirects and rewrites [here](https://docs.netlify.com/routing/redirects/). Here's the setup for proxying Plausible Analytics:
-
-``` title="_redirects"
-/js/script.js https://plausible.io/js/script.js 200
-/api/event https://plausible.io/api/event 200
-```
-
-You can also choose a subdirectory to install Plausible under to make sure it doesn't shadow any routes that you may already have in your application:
-
-``` title="_redirects"
-/your-subdirectory/js/script.js https://plausible.io/js/script.js 200
-/your-subdirectory/api/event https://plausible.io/api/event 200
-```
-
-Choose a generic or irrelevant name for the subdirectory. If you choose something like `analytics` or `plausible`,
-it might get blocked in the future.
-
-Using our [script extensions](script-extensions.md) such as hash-based routing, revenue or outbound link click tracking? Edit your `_redirects` and change the name from `script.js` to the script you want to use: `script.hash.js`, `script.revenue.js` or `script.outbound-links.js`. Want to use more than one extension? You can chain them like this: `script.hash.revenue.outbound-links.js`.
-
-## Step 2: Adjust your deployed script
-
-With the URL rewrites in place, you can change your script tag as follows:
-
-```html
-
-```
-
-In case of a subdirectory installation, you'll also need to add a `data-api` attribute to tell the script where the data should be sent.
-
-```html
-
-```
-
-Deploy these changes to your Netlify site. You can verify the proxy is working by opening your network tab. You should see a request to `https://yourdomain.com/js/script.js` with status 200 and another one to `https://yourdomain.com/api/event` with status 202.
-
-## Troubleshooting
-
-If your `
-```
-
-In case of a subdirectory installation, you'll also need to add a `data-api` attribute to tell the script where
-the data should be sent.
-
-```html
-
-```
-
-
-Deploy these changes to your Next.js site. You can verify the proxy is working by opening your network tab. You should see a request to
-`https://yourdomain.com/js/script.js` with status 200 and another one to `https://yourdomain.com/api/event` with status 202.
-
-Thanks to [sp3n](https://github.com/sp3n) for contributing these instructions!
diff --git a/docs/proxy/guides/nginx.md b/docs/proxy/guides/nginx.md
index e778a776..da581545 100644
--- a/docs/proxy/guides/nginx.md
+++ b/docs/proxy/guides/nginx.md
@@ -8,7 +8,22 @@ If you're already running Nginx as your main web server or reverse proxy, you ca
Our managed proxy lets you send analytics through your own domain name as a first-party connection. All you need to do is set up a CNAME record using the instructions we'll send you and update the snippet on your site. We'll take care of everything else. [Contact us for details](https://plausible.io/contact).
:::
-## Step 1: Update your Nginx config
+## Step 1: Get your snippet
+
+In the "**Site Installation**" area of the "**General**" section in your [site settings](website-settings.md) you can see
+the snippet specific for your site. It will look similar to the following:
+
+```html
+
+
+```
+
+Your snippet will have a different script location than the example above. Look for the `https://plausible.io/js/pa-XXXXX.js` part in your snippet - that's the personalized location for your site's script. Mark it down for subsequent steps.
+
+## Step 2: Update your Nginx config
```
# Only needed if you cache the plausible script. Speeds things up.
@@ -24,7 +39,7 @@ proxy_cache_path /var/run/nginx-cache/jscache levels=1:2 keys_zone=jscache:100m
server {
resolver 9.9.9.9; # Use quad9 DNS resolver. Remove this line if you've already configured a DNS resolver.
- set $plausible_script_url https://plausible.io/js/script.js; # Change this if you use a different variant of the script
+ set $plausible_script_url https://plausible.io/js/pa-XXXXX.js; # Change this to path from step 1
set $plausible_event_url https://plausible.io/api/event;
...
location = /js/script.js {
@@ -57,10 +72,16 @@ server {
}
```
-## Step 2: Adjust your deployed script
+## Step 3: Adjust your deployed script
With the above config in place, you can change the script tag on your site as follows:
```html
-
+
+
```
diff --git a/docs/proxy/guides/vercel.md b/docs/proxy/guides/vercel.md
index a81baf63..e2b6b81f 100644
--- a/docs/proxy/guides/vercel.md
+++ b/docs/proxy/guides/vercel.md
@@ -8,7 +8,22 @@ Our managed proxy lets you send analytics through your own domain name as a firs
If you are hosting a **Next.js** application, see [Proxying Plausible through Next.js / Vercel](/proxy/guides/nextjs.md).
-## Step 1: Add configuration file
+## Step 1: Get your snippet
+
+In the "**Site Installation**" area of the "**General**" section in your [site settings](website-settings.md) you can see
+the snippet specific for your site. It will look similar to the following:
+
+```html
+
+
+```
+
+Your snippet will have a different script location than the example above. Look for the `https://plausible.io/js/pa-XXXXX.js` part in your snippet - that's the personalized location for your site's script. Mark it down for subsequent steps.
+
+## Step 2: Add configuration file
> See Vercel's [project configuration](https://vercel.com/docs/cli#project-configuration) docs
@@ -18,18 +33,18 @@ Add a special `vercel.json` file in your application root:
/vercel.json
```
-## Step 2: Configure rewrites
+## Step 3: Configure rewrites
> See Vercel's [rewrites](https://vercel.com/docs/cli#project-configuration/rewrites) docs
-Add the following JSON to rewrite calls within your application to Plausible's resources:
+Add the following JSON to rewrite calls within your application to Plausible's resources:
```json
{
"rewrites": [
{
"source": "/your-subdirectory/js/script.js",
- "destination": "https://plausible.io/js/script.js"
+ "destination": "https://plausible.io/js/pa-XXXXX.js"
},
{
"source": "/your-subdirectory/api/event",
@@ -39,23 +54,27 @@ Add the following JSON to rewrite calls within your application to Plausible's r
}
```
+Replace `https://plausible.io/js/pa-XXXXX.js` with script location from step 1.
+
Note that:
- The source paths identified here **must be** used when configuring the HTML script tag in the next section.
- You can use whatever paths you like here (for example, here prefixing with `/your-subdirectory/`). Do choose a generic or irrelevant name. If you choose something like analytics, stats or plausible, it might get blocked.
-## Step 3: Add the script tag
+## Step 4: Update your snippet
-> See Plausible's [script tag](plausible-script.md) docs
+> See Plausible's [script tag](plausible-script.md) docs
-Add a script tag to your application's HTML page, passing the values configured above as attributes. The `src` and `data-api` attributes **must match** the `source` values in the `vercel.json` file.
+Add a script tag to your application's HTML page, passing the values configured above as attributes. The `src` and `endpoint` attributes **must match** the `source` values in the `vercel.json` file.
```html
-
+
+
```
Thanks to [davestewart](https://github.com/davestewart) for contributing these instructions!
diff --git a/docs/proxy/introduction.md b/docs/proxy/introduction.md
index 4c1bc993..5567a15e 100644
--- a/docs/proxy/introduction.md
+++ b/docs/proxy/introduction.md
@@ -28,11 +28,7 @@ This section has been introduced after hearing from so many site owners who expe
### Not concerned about missing data?
-Simply run our default script. The easiest way to get started with Plausible Analytics is to install the script from our main domain as follows:
-
-```html
-
-```
+Simply run our default script. The easiest way to get started with Plausible Analytics is to [install the script](/docs/plausible-script.md) from our main domain.
This is the simplest way to install Plausible Analytics but it will also be blocked by a portion of your visitors. In [our testing](https://markosaric.com/google-analytics-blocking/), between 6% and 26% of people block scripts all depending on the type of the site and the audience. In more extreme cases, with very tech-savvy referral sources these numbers can get [up to 60%](https://plausible.io/blog/google-analytics-adblockers-missing-data).
@@ -41,19 +37,22 @@ This is the simplest way to install Plausible Analytics but it will also be bloc
Proxy our script. This is the option for those who want to get more accurate stats. A proxy basically maps certain URLs from your domain to the Plausible domain:
```
-https:///js/script.js -> https://plausible.io/js/script.js
+https:///js/script.js -> https://plausible.io/js/pa-XXXX.js
https:///api/event -> https://plausible.io/api/event
```
-When the browser requests a file at `https://yourdomain.com/js/script.js` it will actually be fetched from `https://plausible.io/js/script.js`. The analytics will work exactly the same but the script will be served without being flagged.
+When the browser requests a file at `https://yourdomain.com/js/script.js` it will actually be fetched from `https://plausible.io/js/pa-XXXXX.js`. The analytics will work exactly the same but the script will be served without being flagged.
+
+In this case, `/js/pa-XXXXX.js` is the script location specific for your site. You can find it it in the "**Site Installation**" area of the "**General**" section in your [site settings](website-settings.md).
+
## How to proxy requests to Plausible
You can proxy requests to Plausible in several ways depending on your setup. If you'd rather not handle it yourself, we also offer a managed proxy option.
-### Managed proxy
+### Managed proxy
-Don't want to manage your own proxy? We can handle it for you. Our managed proxy lets you send analytics through your own domain name as a first-party connection. This helps bypass adblockers and count more traffic without any setup or maintenance on your end.
+Don't want to manage your own proxy? We can handle it for you. Our managed proxy lets you send analytics through your own domain name as a first-party connection. This helps bypass adblockers and count more traffic without any setup or maintenance on your end.
All you need to do is set up a CNAME record using the instructions we'll send you and update the snippet on your site. We'll take care of everything else.
@@ -63,11 +62,8 @@ Managed proxy is available on our Enterprise plans. [Contact us for details](htt
A standalone proxy works with any tech stack or hosting provider. You're responsible for setting it up and keeping it running. You can use one of these options:
-* [Akamai](/docs/proxy/guides/akamai)
* [Cloudflare Workers](/docs/proxy/guides/cloudflare)
* [Fastly](/docs/proxy/guides/fastly)
-* [CloudFront](/docs/proxy/guides/cloudfront)
-* [Google Cloud Platform](https://github.com/mtlynch/plausible-proxy)
* [How to send events directly to our API](/docs/events-api)
### Integrated proxy
@@ -75,11 +71,8 @@ A standalone proxy works with any tech stack or hosting provider. You're respons
These setups depend on how your app is deployed. You'll need to handle the proxy setup and maintenance yourself. Here are the available options:
* [WordPress](/docs/proxy/guides/wordpress)
-* [Netlify](/docs/proxy/guides/netlify)
* [Vercel](/docs/proxy/guides/vercel)
-* [Vercel with Next.JS](/docs/proxy/guides/nextjs)
* [Fresh](/docs/proxy/guides/fresh)
* [Nginx](/docs/proxy/guides/nginx)
* [Apache](/docs/proxy/guides/apache)
* [Caddy](/docs/proxy/guides/caddy)
-* [Django](https://github.com/imankulov/django-plausible-proxy)
diff --git a/docs/script-extensions.md b/docs/script-extensions.md
index ce93288e..6b9de635 100644
--- a/docs/script-extensions.md
+++ b/docs/script-extensions.md
@@ -4,113 +4,86 @@ title: Enable optional measurements
import useBaseUrl from '@docusaurus/useBaseUrl';
-We're proud to have one of the most [lightweight JavaScript snippets](https://plausible.io/lightweight-web-analytics) in the analytics industry.
+The Plausible JavaScript snippet offer enhanced measurements and configuration for tailoring to how you want to use Plausible.
-We achieve that by radically limiting the number of options in the default script. Instead, we offer enhanced measurements as optional script extensions tailored to how you want to use Plausible. This approach makes sure that you only load the code that will actually be used on your website.
-
-You can enable these optional measurements when adding a new site to your Plausible account or in the "**Site Installation**" area of the "**General**" section in your [site settings](website-settings.md).
+Optional measurements can enabled when adding a new site to your Plausible account or in the "**Site Installation**" area of the "**General**" section in your [site settings](website-settings.md).
-:::tip The snippet changes depending on your selection of measurements
-Note that the tracking snippet that you need to insert into your site changes depending on your selection of enhanced measurements. When making changes to your optional measurements, do ensure to insert the newest snippet into your site for all tracking to work as expected
-:::
-
Here's the list of our optional measurements:
| Optional Measurement | Explanation |
|--------------------------|----------------------------------------------------------------------------------------------------|
| Outbound links | Automatically [track clicks on outbound links](outbound-link-click-tracking.md) |
| File downloads | Automatically [track file downloads](file-downloads-tracking.md) |
-| 404 error pages | Automatically [track 404 error pages](error-pages-tracking-404.md) |
-| Hashed page paths | Automatically track page paths that use a `#` in the URL ([hash-based routing](hash-based-routing.md)) |
-| Custom events | Allows you to [track custom events](custom-event-goals.md) such as link clicks, form submits and any other HTML element clicks |
-| Custom properties | Allows you to attach [custom properties](/custom-props/introduction) (also known as custom dimensions in Google Analytics) when sending a pageview or custom event to create custom metrics |
-| Ecommerce revenue | Allows you to assign dynamic [monetary values](ecommerce-revenue-tracking.md) to custom events and track revenue attribution |
+| Form submissions | Automatically [track form submissions](form-submission-tracking.md) |
-
+## `plausible.init()` configuration
-
+Additionally, `plausible.init()` can be called with different options further enhance its behavior. Supported options are:
-## Advanced tracking options
+| Option | Type | Default | Description |
+| -- | -- | -- | -- |
+| endpoint | `string` | `"https://plausible.io/api/event"` | Allows [proxying requests](/proxy/introduction) |
+| hashBasedRouting | `boolean` | `false` | Track page paths that use a `#` in the URL ([hash-based routing](hash-based-routing.md)) |
+| fileDownloads | `boolean` or `{ fileExtensions }` | `false` | Automatically [track file downloads](file-downloads-tracking.md) |
+| outboundLinks | `boolean` | `false` | [track clicks on outbound links](outbound-link-click-tracking.md) |
+| customProperties | `object` or `function(eventName)` | `{}` | [Add custom props globally](/custom-props/introduction) |
+| formSubmissions | `boolean` | `false` | [Track form submissions](form-submission-tracking.md) |
+| captureOnLocalhost | `boolean` | `false` | Enables tracking on localhost for dev environments |
+| autoCapturePageviews | `boolean` | `true` | Automatically track pageviews |
+| logging | `boolean` | `true` | Enable/disable logging done by script |
+| transformRequest | `function(payload)` | – | Modify or filter events before sending (e.g. [for custom locations](/custom-locations))|
-
-In addition to the above list (`script.outbound-links.js`, `script.file-downloads.js`, `script.hash.js`, `script.tagged-events.js`, `script.pageview-props.js` and `script.revenue.js`), we also have some more advanced tracking options available. Note that these are not included in the site onboarding list so you will need to insert them into your tracking snippet manually.
+## Advanced tracking recipes
-| Extension | Explanation |
-|--------------------------|----------------------------------------------------------------------------------------------------|
-| script.compat.js | Compatibility mode for [tracking users on Internet Explorer](#scriptcompatjs) (≥IE11) |
-| script.local.js | Allow analytics to track on localhost too which is useful in hybrid apps |
-| script.manual.js | [Don't trigger pageviews automatically](#scriptmanualjs). Also allows you to [specify custom locations](custom-locations.md) to redact URLs with identifiers. You can also use it to track [custom query parameters](custom-query-params.md)|
+### Tracking 404 error pages
-### How to manually change the tracking snippet
+See guide for [tracking 404 error pages](error-pages-tracking-404.md)
-For example, the default script name in our snippet is `script.js`. If your website is on a localhost and you'd like to track those visits, you have the option of loading the script with a different extension: `script.local.js`.
+### Tracking custom events
-In this case, the snippet you need to insert into your site is as follows (make sure to change the data-domain attribute to the domain you added to Plausible):
+See guide for [tracking custom events such as link clicks or any other HTML element clicks](custom-event-goals.md)
-```html
-
-```
+### Attaching custom properties
-You can mix and match, and combine these extensions any way that you wish. For instance, if you want to use both our hash-based routing and our outbound link click tracking, you can combine them as follows: `script.hash.outbound-links.js`.
+See guide for [attaching custom properties](/custom-props/introduction) (also known as custom dimensions in Google Analytics) when sending a pageview or custom event to create custom metrics.
-In this case, the snippet you need to insert into your site is as follows (make sure to change the data-domain attribute to the domain you added to Plausible):
+### Ecommerce revenue
-```html
-
-```
+See guide for [assigning dynamic monetary values](ecommerce-revenue-tracking.md) to custom events and track revenue attribution
-Or say you want to use our `script.revenue.js` extension to track ecommerce revenue and our `script.local.js` extension to track localhost traffic, your snippet should look like this:
+### Manual pageviews
-```html
-
-```
+By default, the Plausible script triggers a pageview when it's first loaded. It also attaches listeners to the History API and will automatically trigger pageviews when you use `history.pushState`. This is useful for most websites but we also allow disabling `autoCapturePageviews` in case you want full control over when pageviews are triggered on your website.
-And you only need to insert that one snippet into your site, no need for anything else.
+One of the use-cases for this is when you use [Turbo](https://turbo.hotwired.dev/) (formerly [Turbolinks](https://github.com/turbolinks/turbolinks)). In that case, you want to manually trigger Plausible pageviews on the `turbo:load` or `turbolinks:load` browser event depending which library you use.
-### script.compat.js
+To do so, add update `plausible.init` to disable `autoCapturePageviews`: `plausible.init({ autoCapturePageviews: false })`
-The default Plausible script won't work on Internet Explorer because it uses the [document.currentScript](https://caniuse.com/document-currentscript) API to read configuration options. You can run Plausible in compatibility mode by including the `script.compat.js` extension and defining `id="plausible"` on the script tag so that it can find itself. Note that this works only on ≥ IE11. Here's how it should look like:
+Additionally, add a javascript listener that triggers pageviews on turbolinks navigation:
-```html
-
-```
-
-### script.manual.js
-
-By default, the Plausible script triggers a pageview when it's first loaded. It also attaches listeners to the History API and will automatically trigger pageviews when you use `history.pushState`. This is useful for most websites but we also offer a manual mode in case you want full control over when pageviews are triggered on your website.
-
-One of the use-cases for this is when you use [Turbo](https://turbo.hotwired.dev/) (formerly [Turbolinks](https://github.com/turbolinks/turbolinks)). In that case, you want to manually trigger Plausible pageviews on the `turbo:load` or `turbolinks:load` browser event depending which library you use. Here's how you can do that:
-
-```html
-
-
-
-
-
```
-When using turbolinks, you should make sure that the Plausible script isn't loaded and executed during turbo navigation. You may need to move the script to the `` section of your website or use the `data-turbo-eval="false"` attribute to do so.
-
-:::note
-When using manual.js every script call with `'pageview'` results in a separate pageview being counted even if called on the same page
+:::note
+Every script call with `'pageview'` results in a separate pageview being counted even if called on the same page
:::
#### Specify custom locations for your page URLs
-Additionally, the manual script extension allows you to provide a special option named `u` with your events. This allows you to specify the URL of the page and can be used to specify custom locations.
+Triggering pageviews manually allows you to provide a special option named `url` with your events. This allows you to specify the URL of the page and can be used to specify custom locations.
It's especially helpful to redact and aggregate multiple pages whose URLs contain identifiers that are specific to users. [Learn more about specifying custom URLs in your events](custom-locations.md).
+
#### Track custom query parameters for complete page URLs
-By default, Plausible strips all query parameters for privacy purposes [except for](top-referrers.md) `ref`, `source`, `utm_source`, `utm_medium`, `utm_campaign`, `utm_content` and `utm_term`.
+By default, Plausible strips all query parameters for privacy purposes [except for](top-referrers.md) `ref`, `source`, `utm_source`, `utm_medium`, `utm_campaign`, `utm_content` and `utm_term`.
This means that pages like `yoursite.com/blog/index.php?article=some_article&page=11` will be reported as `yoursite.com/blog/index.php` in the "**Top Pages**" report of your Plausible dashboard.
@@ -119,5 +92,3 @@ By using the manual script extension, you can also track custom query parameters
:::tip Want to track outbound link clicks or file downloads cloaked with pretty URLs?
See these [step-by-step instructions](custom-automatic-link-tracking.md) for how to do that.
:::
-
-
diff --git a/docs/script-update-guide.md b/docs/script-update-guide.md
new file mode 100644
index 00000000..844ad8f9
--- /dev/null
+++ b/docs/script-update-guide.md
@@ -0,0 +1,120 @@
+---
+title: Update your Plausible script
+---
+
+In September 2025, Plausible released a new version of their tracking script. This document outlines
+the differences from the old script and how to migrate.
+
+## Why a new script?
+
+Our previous approach with various script extensions could be uncomfortable to Plausible users
+to manage. A new script also allows Plausible developers to build out new features.
+
+## Getting the new snippet
+
+You can see the new snippet within the "**Site Installation**" area of the "**General** section in your [site settings](website-settings.md).
+
+Your Plausible tracking snippet should be inserted into [the Header (``) section of your site](plausible-script.md). Place the tracking script within the ` … ` tags.
+
+## What has changed?
+
+This section outlines what has changed in the new snippet and how to adjust your setup.1
+
+### 1. Each site has a unique snippet
+
+As a result, selecting new optional enhanced measurements no longer requires updating the snippet.
+
+### 2. New feature: Form submission tracking
+
+Tracking form submissions can now be toggled on and off in **Site Installation** settings.
+
+### 3. Changed: Custom properties
+
+If you were using data-attributes for custom properties, you will need to add `customProperties` option with your custom properties
+
+```javascript
+plausible.init({
+ customProperties: {
+ author: "John Doe"
+ }
+})
+```
+
+Read more about custom properties in [custom pageview properties](/custom-props/for-pageviews) documentation.
+
+### 4. Changed: Custom tracking endpoint
+
+The new script no longer supports the `data-api` attribute to send events to a custom endpoint. Set `endpoint` option instead:
+
+```javascript
+plausible.init({
+ // Replace with your custom endpoint
+ endpoint: "https://plausible.io/api/event"
+})
+```
+
+### 5. Changed: custom file download types
+
+To track file downloads only for certain file types, you will need to set `fileDownloads` option:
+
+```javascript
+plausible.init({
+ fileDownloads: {
+ fileExtensions: ["pdf"]
+ }
+})
+```
+
+By default, plausible tracks the following file types: pdf, xlsx, docx, txt, rtf, csv, exe, key, pps, ppt, pptx, 7z, pkg, rar, gz, zip, avi, mov, mp4, mpeg, wmv, midi, mp3, wav, wma, dmg
+
+### 6. Changed: Hashed page paths
+
+If you were previously using a hash based routing and had a `.hash` in your script path, you will need to set `hashBasedRouting` option:
+
+```javascript
+plausible.init({
+ hashBasedRouting: true
+})
+```
+
+See also [Hashed page paths guide](/hash-based-routing.md)
+
+### 7. Changed: Tracking pageviews manually
+
+If you were previously using the `manual` extension to track pageviews manually, you will need to set `autoCapturePageviews` option to `false`:
+
+```javascript
+plausible.init({
+ autoCapturePageviews: false
+})
+```
+
+See also [Custom locations guide](/custom-locations).
+
+### 8. Changed: Tracking on localhost
+
+If you were previously using `local` extension to track events on localhost, you will need to set `captureOnLocalhost` option to `true`:
+
+```javascript
+plausible.init({
+ captureOnLocalhost: true
+})
+```
+
+### 9. Changed: Custom events and revenue features are automatically enabled
+
+If you were already using these features, no additional steps are required. Documentation links:
+- [Custom events](/custom-event-goals)
+- [Ecommerce revenue and attribution tracking](docs/ecommerce-revenue-tracking.md)
+
+### 10. Removed: `data-exclude`
+
+The new script no longer supports the `data-exclude` and `data-include` attributes. See [alternative guide](/excluding.md) instead.
+
+### 11. Removed: multiple domain support
+
+The new script does not support sending stats to multiple dashboards at once anymore. Keep using the old script for this functionality.
+
+## Google tag manager {#gtm}
+
+If you've installed Google Tag Manager using previous instructions, you will need to delete the old tag and install us [using tag manager gallery](/docs/google-tag-manager.md).
diff --git a/docs/shopify-integration.md b/docs/shopify-integration.md
index b689771a..17cf0bd8 100644
--- a/docs/shopify-integration.md
+++ b/docs/shopify-integration.md
@@ -8,7 +8,7 @@ Here's how to add Plausible Analytics to your Shopify store and set up the track
## Add Plausible snippet to Shopify
-* Log in to your Shopify account and click on Sales Channels > Online Store > Themes in the left-hand side menu.
+* Log in to your Shopify account and click on Sales Channels > Online Store > Themes in the left-hand side menu.
* Click on the icon with three dots next to your current theme and choose "**Edit code**" from the drop-down menu.
@@ -22,7 +22,7 @@ Here's how to add Plausible Analytics to your Shopify store and set up the track
## Track checkouts and revenue attribution
-Even after having added the Plausible snippet into your `theme.liquid` file, checkout pages such as `/checkouts/cn/:id/review` or `/checkouts/cn/:id/thank-you` will not be tracked yet. That's because they're not using the same theme layout. To enable pageview tracking on checkout pages, you need to create a custom pixel. The same pixel can also be used for tracking Shopify's customer events (e.g. `"product_added_to_cart"`, `"checkout_completed"`, etc...) with revenue attribution and custom properties.
+Even after having added the Plausible snippet into your `theme.liquid` file, checkout pages such as `/checkouts/cn/:id/review` or `/checkouts/cn/:id/thank-you` will not be tracked yet. That's because they're not using the same theme layout. To enable pageview tracking on checkout pages, you need to create a custom pixel. The same pixel can also be used for tracking Shopify's customer events (e.g. `"product_added_to_cart"`, `"checkout_completed"`, etc...) with revenue attribution and custom properties.
To create the custom pixel, follow these steps:
@@ -77,7 +77,7 @@ Track pageviews on checkout page paths such as:
// Track pageviews on checkout pages
analytics.subscribe('page_viewed', async (event) => {
const loc = event.context.document.location;
-
+
// This "if" condition makes sure only checkout paths are tracked.
// The "page_viewed" customer event is also fired for other pages,
// but those should be tracked by the global snippet installed in
@@ -90,7 +90,7 @@ analytics.subscribe('page_viewed', async (event) => {
You can then group all visits to checkout pages into one set of pages in your Plausible dashboard to better analyze your marketing campaigns and performance.
-Click on the "**Filter**" button on the top right of your dashboard and then choose "**Page**". Here you can combine URLs to analyze them as one group. Filter by "**contains**" `thank_you` to combine all the purchase confirmations or by "**contains**" `checkouts` to group all the checkouts.
+Click on the "**Filter**" button on the top right of your dashboard and then choose "**Page**". Here you can combine URLs to analyze them as one group. Filter by "**contains**" `thank_you` to combine all the purchase confirmations or by "**contains**" `checkouts` to group all the checkouts.
Doing this will segment your dashboard by the traffic that went through the checkout process and successfully placed orders. You'll be able to see the referral sources and landing pages that drove the most conversions. You'll also be able to see the location and device details of the buyers too.
@@ -100,14 +100,14 @@ If you'd like to see these grouped order confirmations or checkout page visits p
### Track started checkouts
-Send a custom event called "**Begin Checkout**" to Plausible every time the checkout process is started. The total price of the shopping cart will be recorded under this event.
+Send a custom event called "**Begin Checkout**" to Plausible every time the checkout process is started. The total price of the shopping cart will be recorded under this event.
```javascript
// Track started checkouts
analytics.subscribe('checkout_started', async (event) => {
const amount = event.data.checkout.totalPrice.amount;
const currency = event.data.checkout.currencyCode;
-
+
plausible('Begin Checkout', {
revenue: {amount: amount, currency: currency},
u: event.context.document.location.href
@@ -121,14 +121,14 @@ In order to see this information on your Plausible dashboard, you should:
### Track payment info added during checkout
-Send a custom event called "**Add Payment Info**" to Plausible every time payment information is submitted by a customer during the checkout. The total price of the shopping cart will be recorded under this event.
+Send a custom event called "**Add Payment Info**" to Plausible every time payment information is submitted by a customer during the checkout. The total price of the shopping cart will be recorded under this event.
```javascript
// Track payment info added during checkout
analytics.subscribe('payment_info_submitted', async (event) => {
const amount = event.data.checkout.totalPrice.amount;
const currency = event.data.checkout.currencyCode;
-
+
plausible('Add Payment Info', {
revenue: {amount: amount, currency: currency},
u: event.context.document.location.href
@@ -142,14 +142,14 @@ In order to see this information on your Plausible dashboard, you should:
### Track completed checkouts (purchases)
-Send a custom event called "**Purchase**" to Plausible every time a checkout is completed. The total amount paid by the customer will be recorded under this event.
+Send a custom event called "**Purchase**" to Plausible every time a checkout is completed. The total amount paid by the customer will be recorded under this event.
```javascript
// Track completed checkouts
analytics.subscribe('checkout_completed', async (event) => {
const amount = event.data.checkout.totalPrice.amount;
const currency = event.data.checkout.currencyCode;
-
+
plausible('Purchase', {
revenue: {amount: amount, currency: currency},
u: event.context.document.location.href
@@ -250,7 +250,7 @@ The `plausible` function takes two arguments:
1. an event name which can be whatever you like - just make sure to [set up a goal](/custom-event-goals#step-4-create-a-custom-event-goal-in-your-plausible-account) with the same name to see it on your dashboard.
2. an object where a few options can be passed:
-* [Object] `revenue` - allows you to attribute a monetary value to your Plausible event. The object needs to contain two keys: `amount` and `currency`. Note that you can only attribute a single monetary value to one event. The revenue option is ignored until you've [set up a revenue goal](ecommerce-revenue-tracking#step-3-add-a-new-custom-event-and-specify-the-currency-of-your-choice) in your Plausible dashboard. That's because currency conversion into your desired reporting currency happens at the time of receiving the event.
+* [Object] `revenue` - allows you to attribute a monetary value to your Plausible event. The object needs to contain two keys: `amount` and `currency`. Note that you can only attribute a single monetary value to one event. The revenue option is ignored until you've [set up a revenue goal](ecommerce-revenue-tracking#step-3-add-a-new-custom-event-and-specify-the-currency-of-your-choice) in your Plausible dashboard. That's because currency conversion into your desired reporting currency happens at the time of receiving the event.
* [Object] `props` - here you can pass any value under any key you'd like. The key you choose will become the name of the custom property that you need to [configure in your site settings](/custom-props/props-dashboard#1-configure-custom-properties-in-your-site-settings). Note that you are responsible for ensuring that no [personally identifiable information](/custom-props/introduction#personally-identifiable-information) is tracked.
* [String] `u` - this field stands for the `url` of the page where this customer event happened. You will most likely want to just keep it the same as in the example. It's important to always pass this option because otherwise the url will become the location of the pixel which has nothing to do with the real location where the event happened.
@@ -264,25 +264,17 @@ The `plausible` function takes two arguments:
Here's how you can track particular form submissions and button clicks on your Shopify site:
-### 1. Enable "Custom events" for your site
-
-You can enable "**Custom events**" as an optional measurement when adding a new site to your Plausible account. If the site has already been added to your account, you can control what data is collected in the "**Site Installation**" area of the "**General**" section in your [site settings](website-settings.md).
-
-### 2. Change the snippet on your site
-
-The tracking snippet changes depending on your selection of optional measurements. When making changes to your optional measurements, do ensure to insert the newest snippet into your site for all tracking to work as expected.
-
-### 3. Find the ID attribute of the form or button you want to track
+### 1. Find the ID attribute of the form or button you want to track
Your form or button element should have an ID attribute assigned by default. You can find this ID by selecting the element you want to track (do make sure you select your form element and not just the "Submit" button) and clicking on the settings gear.
-### 4. Trigger custom events with JavaScript on your site
+### 2. Trigger custom events with JavaScript on your site
Here's the code you will need to insert in the `` section of the page where the element ID that you want to track is located. You can do this the same way as you've inserted the Plausible snippet into your site.
-Make sure to change the `elementId` line in the code below to include the ID attribute of the element you want to track (`ContactForm` in our example).
+Make sure to change the `elementId` line in the code below to include the ID attribute of the element you want to track (`ContactForm` in our example).
Also do change the `classes` line to include the goal name in this format: `plausible-event-name=Goal+Name`. The goal name is completely up to you. It's the name under which the goal conversions will appear in your Plausible dashboard. We've used `Form+Submit` goal name in our example.
@@ -314,7 +306,7 @@ To represent a space character in goal names, you can use a `+` sign. For exampl
Do click on the "**Save**" button to save your changes.
-### 5. Create a custom event goal in your Plausible account
+### 3. Create a custom event goal in your Plausible account
When you send custom events to Plausible, they won't show up in your dashboard automatically. You'll have to configure the goal for the conversion numbers to show up.
@@ -328,9 +320,9 @@ So in our example where we added a goal name `plausible-event-name=Form+Submit`
-Next, click on the "**Add goal**" button and you'll be taken back to the Goals page.
+Next, click on the "**Add goal**" button and you'll be taken back to the Goals page.
-### 6. Your goal should now be ready and tracking
+### 4. Your goal should now be ready and tracking
Your goal should now be set up. When you navigate back to your Plausible Analytics dashboard, you should see the number of visitors who triggered the custom event. Goal conversions are listed at the very bottom of the dashboard. The goal will show up in your dashboard as soon as it has been completed at least once.
@@ -347,7 +339,7 @@ If you want to trigger multiple custom events on the same site, you don't need t
},
{
elementId: 'button-ID',
- classes: 'plausible-event-name=Button+Click'
+ classes: 'plausible-event-name=Button+Click'
}
]
diff --git a/docs/sites-api.md b/docs/sites-api.md
index a26740ac..6140f975 100644
--- a/docs/sites-api.md
+++ b/docs/sites-api.md
@@ -11,6 +11,7 @@ The Plausible Site provisioning API offers a way to create and manage sites in y
* Create a new site
* Delete an existing site
* Change a domain name
+* Configure tracker script settings
* Get a site by domain
* Find or create a shared link by name (to use for the [embed dashboard functionality](embed-dashboard.md))
* List existing goals
@@ -154,18 +155,39 @@ Creates a site in your Plausible account.
```bash title="Try it yourself"
curl -X POST https://plausible.io/api/v1/sites \
-H "Authorization: Bearer ${TOKEN}" \
- -F 'domain="test-domain.com"' \
- -F 'timezone="Europe/London"'
+ -H "Content-Type: application/json" \
+ -d '{
+ "domain": "test-domain.com",
+ "timezone": "Europe/London",
+ "tracker_script_configuration": {
+ "file_downloads": true,
+ "form_submissions": true,
+ "outbound_links": true
+ }
+ }'
```
```json title="Response 200 OK"
{
"domain": "test-domain.com",
- "timezone": "Europe/London"
+ "timezone": "Europe/London",
+ "custom_properties": [],
+ "tracker_script_configuration": {
+ "id": "pa-1iQepzD1J73BaHey2csUp",
+ "installation_type": null,
+ "track_404_pages": false,
+ "hash_based_routing": false,
+ "outbound_links": true,
+ "file_downloads": true,
+ "revenue_tracking": false,
+ "tagged_events": false,
+ "form_submissions": true,
+ "pageview_props": false
+ }
}
```
-#### Post body parameters
+#### Body parameters
**domain**
@@ -184,31 +206,62 @@ ID of the team under which the created site is to be put. Defaults to the ID of
+**tracker_script_configuration**
+
+Configuration object for the tracker script for this site. When not provided, the default configuration is set. When provided or provided partially (all options are optional), allows you to customize tracking features (any option that is not specified is set to the default value). See [Tracker script configuration](#tracker-script-configuration).
+
+
+
### PUT /api/v1/sites/:site_id
-Update an existing site in your Plausible account. Note: currently only `domain` change is allowed.
+Update an existing site in your Plausible account. You can change the domain name and/or update tracker script configuration.
```bash title="Try it yourself"
curl -X PUT https://plausible.io/api/v1/sites/test-domain.com \
-H "Authorization: Bearer ${TOKEN}" \
- -F 'domain="new-test-domain.com"'
+ -H "Content-Type: application/json" \
+ -d '{
+ "domain": "new-test-domain.com",
+ "tracker_script_configuration": {
+ "form_submissions": true
+ }
+ }'
```
```json title="Response 200 OK"
{
"domain": "new-test-domain.com",
- "timezone": "Europe/London"
+ "timezone": "Europe/London",
+ "custom_properties": [],
+ "tracker_script_configuration": {
+ "id": "pa-1iQepzD1J73BaHey2csUp",
+ "installation_type": null,
+ "track_404_pages": false,
+ "hash_based_routing": false,
+ "outbound_links": false,
+ "file_downloads": false,
+ "revenue_tracking": false,
+ "tagged_events": false,
+ "form_submissions": true,
+ "pageview_props": false
+ }
}
```
-#### Post body parameters
+#### Body parameters
-**domain**
+**domain**
Domain of the site to be created in Plausible. Must be a globally unique, the request will fail if the domain is already taken.
+**tracker_script_configuration**
+
+Configuration object for the tracker script for this site. When not provided, the current configuration is kept. When provided or provided partially, allows you to update settings for tracking features (any option that is not specified is kept at the current value). See [Tracker script configuration](#tracker-script-configuration).
+
+
+
### DELETE /api/v1/sites/:site_id
Deletes a site from your Plausible account along with all its data and configuration. The API key must belong to the owner of the site.
@@ -227,7 +280,7 @@ curl -X DELETE https://plausible.io/api/v1/sites/test-domain.com \
### GET /api/v1/sites/:site_id
-Gets details of a site. Your Plausible account must have access to it.
+Gets details of a site. Your Plausible account must have access to it. The response includes the tracker script configuration for the site and its ID, which you can use to request the tracker script for this site. See [Tracker script URL](#tracker-script-url).
```bash title="Try it yourself"
curl -X GET https://plausible.io/api/v1/sites/test-domain.com \
@@ -238,7 +291,19 @@ curl -X GET https://plausible.io/api/v1/sites/test-domain.com \
{
"domain": "test-domain.com",
"timezone": "Europe/London",
- "custom_properties": ["logged_in"]
+ "custom_properties": ["logged_in"],
+ "tracker_script_configuration": {
+ "id": "pa-1iQepzD1J73BaHey2csUp",
+ "installation_type": null,
+ "track_404_pages": false,
+ "hash_based_routing": false,
+ "outbound_links": false,
+ "file_downloads": false,
+ "revenue_tracking": false,
+ "tagged_events": false,
+ "form_submissions": false,
+ "pageview_props": false
+ }
}
```
@@ -250,9 +315,11 @@ Finds or creates a shared link for a given `site_id` (use the site domain as the
```bash title="Try it yourself"
curl -X PUT https://plausible.io/api/v1/sites/shared-links \
-H "Authorization: Bearer ${TOKEN}" \
- -F 'site_id="test-domain.com"' \
- -F 'name="Wordpress"'
-```
+ -H "Content-Type: application/json" \
+ -d '{
+ "site_id": "test-domain.com",
+ "name": "Wordpress"
+ }'
```json title="Response 200 OK"
{
@@ -346,10 +413,12 @@ Finds or creates a goal for a given `site_id` (use the site domain as the ID). T
```bash title="Try it yourself"
curl -X PUT https://plausible.io/api/v1/sites/goals \
-H "Authorization: Bearer ${TOKEN}" \
- -F 'site_id="test-domain.com"' \
- -F 'goal_type="event"' \
- -F 'event_name="Signup"'
-```
+ -H "Content-Type: application/json" \
+ -d '{
+ "site_id": "test-domain.com",
+ "goal_type": "event",
+ "event_name": "Signup"
+ }'
```json title="Response 200 OK"
{
@@ -400,8 +469,10 @@ Deletes a goal from your Plausible account. The API key must belong to the owner
```bash title="Try it yourself"
curl -X DELETE https://plausible.io/api/v1/sites/goals/1 \
-H "Authorization: Bearer ${TOKEN}" \
- -F 'site_id="test-domain.com"'
-```
+ -H "Content-Type: application/json" \
+ -d '{
+ "site_id": "test-domain.com"
+ }'
```json title="Response 200 OK"
{
@@ -484,11 +555,14 @@ For a given `site_id` (use the site domain as the ID), finds an invitation or ex
```bash title="Try it yourself"
curl -X PUT https://plausible.io/api/v1/sites/guests \
- -H "Authorization: Bearer ${TOKEN}" \
- -F 'site_id="test-domain.com"' \
- -F 'role="viewer"' \
- -F 'email="alice@example.com"'
- ```
+ -H "Authorization: Bearer ${TOKEN}" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "site_id": "test-domain.com",
+ "role": "viewer",
+ "email": "alice@example.com"
+ }'
+```
```json title="Response 200 OK"
{
@@ -555,3 +629,21 @@ curl -X GET https://plausible.io/api/v1/sites?after=AFTER_VALUE_FROM_LAST_RESPON
```
The `limit` parameter must remain the same when paginating, either by leaving it at a default value or passing the same value each time explicitly. The `null` value in `before` or `after` means there are no more previous or next pages to navigate to, respectively.
+
+## Tracker script configuration
+
+This parameter is used to configure the tracker script for a site. It is a JSON object with the following parameters, all of which are optional.
+
+- **installation_type**: Type of installation (`"wordpress"`, `"manual"`, `"gtm"`, `null`). Defaults to `null`.
+- **track_404_pages**: Whether to track 404 page visits. Defaults to `false`.
+- **hash_based_routing**: Whether to track hash-based routing changes. Defaults to `false`.
+- **outbound_links**: Whether to track outbound link clicks. Defaults to `false`.
+- **file_downloads**: Whether to track file downloads. Defaults to `false`.
+- **revenue_tracking**: Whether to enable revenue tracking. Defaults to `false`.
+- **tagged_events**: Whether to enable tagged events. Defaults to `false`.
+- **form_submissions**: Whether to track form submissions. Defaults to `false`.
+- **pageview_props**: Whether to enable pageview properties. Defaults to `false`.
+
+### Tracker script URL
+
+The resolved configuration is returned in GET/PUT/POST site endpoints response along with an ID. This ID can be used to request the tracker script for this site from the URL `https://plausible.io/js/{id}.js`.
diff --git a/docs/stop-tracking-utm-tags.md b/docs/stop-tracking-utm-tags.md
index c315c882..b5b64f14 100644
--- a/docs/stop-tracking-utm-tags.md
+++ b/docs/stop-tracking-utm-tags.md
@@ -4,53 +4,27 @@ title: Stop tracking UTM tags and other query parameters
By default, Plausible strips all query parameters for privacy purposes [except for](top-referrers.md) `ref`, `source`, `utm_source`, `utm_medium`, `utm_campaign`, `utm_content` and `utm_term`. If you prefer to stop tracking these parameters as well, please follow these instructions:
-## 1. Add the `manual` script extension
+## Set `transformRequest` option in `plausible.init`
-You should use [our manual script extension](script-extensions.md). To do so, please change your Plausible script snippet `src` attribute from `https://plausible.io/js/script.js` to `https://plausible.io/js/script.manual.js`.
+The easiest way to stop tracking parameters is to use `transformRequest` to update the URL property sent to Plausible and prevent the tracking of UTM tag.
-The new snippet will look like this (make sure to change the `data-domain` attribute to the domain you added to your Plausible account):
+To do so, in your Plausible tracking snippet, add the following:
-```html
-
-```
-Do this on all the pages where you want to stop tracking UTM tags and other query parameters.
-
-## 2. Trigger the pageview event with a custom `u` attribute
-
-Once you've started using the manual extension, the `pageview` event won't be sent automatically. This means that the stats won't be tracked anymore by default. You'll have to trigger the events to be counted manually.
-
-To trigger events manually, you need to add the following script after your regular Plausible tracking snippet:
+```javascript
+function queryStrippedUrl() {
+ return location.href.split('?')[0]
+}
-```html
-
-
-```
-
-Once that's done, you can create another script in which you will trigger your pageview event. This is where you can override the URL property sent to Plausible and prevent the tracking of UTM tags. To do so, add the following snippet:
-
-```html
-
-
-```
+function transformRequest(payload) {
+ // Sets url for the event manually
+ payload.u = queryStrippedUrl()
+ return payload
+}
-At this point, your entire setup should look like this:
-
-```html
-
-
-
-
-
+// At the end, update plausible.init call:
+plausible.init({
+ transformRequest: transformRequest
+})
```
That's it! You're now no longer tracking any UTM tags or other parameters. We will use the [referrer header](top-referrers.md) to display the sources of the traffic instead. If the referring site doesn't send any referrer header, the traffic will fall within the "**Direct / None**" source.
diff --git a/docs/top-pages.md b/docs/top-pages.md
index 0035ed4f..df8d9181 100644
--- a/docs/top-pages.md
+++ b/docs/top-pages.md
@@ -53,6 +53,6 @@ Plausible Analytics records the URL path of each page view as the visitors are b
* Do you see identical page paths with and without a trailing slash (`/some_article` and `/some_article/`) in your pages report? This points to a duplicate content issue on the site and can be solved [with a 301 redirect](https://ahrefs.com/blog/trailing-slash/)
-* If your website is a single-page application with `pushState` routing, Plausible Analytics will track page views automatically with no extra work. If you're using a frontend framework that uses the URL hash for routing, we also have a special [hash-based script](hash-based-routing.md)
+* If your website is a single-page application with `pushState` routing, Plausible Analytics will track page views automatically with no extra work. If you're using a frontend framework that uses the URL hash for routing, you can enable [hash-based routing in our script](hash-based-routing.md)
P.S. You can learn more about using this information as a site owner [here](https://plausible.io/blog/analyzing-landing-pages#how-to-use-this-information-as-a-site-owner).
diff --git a/docs/troubleshoot-integration.md b/docs/troubleshoot-integration.md
index 96fd5d18..ed0ebf66 100644
--- a/docs/troubleshoot-integration.md
+++ b/docs/troubleshoot-integration.md
@@ -8,7 +8,7 @@ After you've [added the Plausible snippet to your site](plausible-script.md), th
If you see the dashboard with graphs and numbers, it means everything is working and we've counted your first visitor. Congrats! Plausible is now tracking your website statistics while preserving the privacy of your visitors.
-Do you keep seeing a blinking green dot screen instead of the dashboard? The blinking green dot indicates that we’re listening for incoming visits in real-time but haven't recorded any yet.
+Do you keep seeing a blinking green dot screen instead of the dashboard? The blinking green dot indicates that we’re listening for incoming visits in real-time but haven't recorded any yet.
Our testing tool will launch automatically from the blinking green dot screen to send test traffic to your site. This test traffic won't be recorded in the dashboard but you'll see a status message indicating whether Plausible Analytics has been installed correctly.
@@ -20,35 +20,29 @@ Did our testing tool detect an issue with your integration? Or is there somethin
We've put together [many integration guides](integration-guides.md) that cover popular website builders and content management systems (CMS) such as WordPress and Ghost. Thanks to the members of our community, there are also community integrations and plugins for several frameworks such as Hugo and GatsbyJS. These can help you set up and start counting your site visitors in no time.
-## Have you added the correct data-domain attribute in the Plausible snippet?
-
-View the source code of your site. You can right-click anywhere on your page and click "View Page Source" (the wording may be slightly different depending on your web browser). Then press Command+f on a Mac or ctrl+f on Linux and Windows to search. Type "**data-domain**" to search for the Plausible snippet.
-
-Does the snippet look as expected? Is the data-domain attribute within the snippet an exact match to the site as you've added it to your Plausible account? The data-domain must be an exact match for the stats to be recorded.
-
## Have you cleared the cache of your site?
If you are using caching on your site, the latest version of your site where our snippet is integrated may not be showing to all your visitors yet. Do purge the cache to ensure that you're presenting the latest version of your site to all your visitors.
-## Have you implemented Plausible using Google Tag Manager?
+## Have you implemented Plausible using Google Tag Manager?
GTM strips the `data-*` attributes by default which can break the tracking. Please follow [our GTM guide](google-tag-manager.md) for instructions on how to integrate Plausible using GTM.
-## Does your site use a Content Security Policy (CSP)?
+## Does your site use a Content Security Policy (CSP)?
If it does, you would need to add our domain name (plausible.io) specifically to the allowed domains list in order for the script to work. [More info here](https://github.com/plausible/docs/issues/20).
-## Are you running on localhost?
+## Are you running on localhost?
-Our script automatically disables itself when running on localhost as most people don't want those stats to be counted. In the `script.js` script, `window.location.hostname` is used to verify that. If you do want to track stats on localhost, you can [use our extension](script-extensions.md).
+Our script automatically disables itself when running on localhost as most people don't want those stats to be counted. In the `script.js` script, `window.location.hostname` is used to verify that. If you do want to track stats on localhost, [see configuration guide](script-extensions.md).
-## Are you running a Google AMP page?
+## Are you running a Google AMP page?
To track Google AMP pages with Plausible, you need to declare an AMP-analytics object on your AMP pages. [See the instructions here](https://github.com/plausible/analytics/discussions/220#discussioncomment-904022).
## Did you insert multiple Plausible snippets into your site?
-This may affect the accuracy of the tracking and can result in the stats being counted twice. Please make sure to only insert one snippet.
+This may affect the accuracy of the tracking and can result in the stats being counted twice. Please make sure to only insert one snippet.
## Are you using an older version of our script?
@@ -63,11 +57,11 @@ If you're using [our WordPress plugin](https://plausible.io/wordpress-analytics-
This ensures the changes are fully applied and the latest version of our script is properly loaded.
-## Has some other plugin altered our snippet?
+## Has some other plugin altered our snippet?
-Are you using WP Rocket, SiteGround Optimizer or other performance optimization plugins? Or some type of consent banner plugin that determines which scripts can run when? These plugins may affect our tracking as they try to optimize our script. If you're on WordPress, we recommend you use [our official WordPress plugin](https://plausible.io/wordpress-analytics-plugin) to avoid these issues as we've built-in resolutions to the most common plugin conflicts.
+Are you using WP Rocket, SiteGround Optimizer or other performance optimization plugins? Or some type of consent banner plugin that determines which scripts can run when? These plugins may affect our tracking as they try to optimize our script. If you're on WordPress, we recommend you use [our official WordPress plugin](https://plausible.io/wordpress-analytics-plugin) to avoid these issues as we've built-in resolutions to the most common plugin conflicts.
-Do you experience an issue even when using our plugin? Do check your integration manually using the steps below to identify which plugin is in question. Then please whitelist our script location and our domain name in the settings of the individual plugin to stop it from altering our snippet.
+Do you experience an issue even when using our plugin? Do check your integration manually using the steps below to identify which plugin is in question. Then please whitelist our script location and our domain name in the settings of the individual plugin to stop it from altering our snippet.
## Have you placed our script behind the GDPR consent banner?
@@ -117,9 +111,9 @@ In some cases, our automated testing tool may not be able to check your site. In
A simple way to verify if Plausible is working is to view the source code of your site and look for the Plausible snippet. Here's how:
-1. Visit your home page or any other page on your site where Plausible is installed.
-2. View the source code of your site. You can right-click anywhere on your page and click "**View Page Source**" (the wording may be slightly different depending on your web browser). Alternatively, use a keyboard shortcut to view the source code (`Option+Command+u` on a Mac or `ctrl+u` on Linux and Windows).
-3. Press `Command+f` on a Mac or `ctrl+f` on Linux and Windows to search the source code. Type `data-domain` to search for the Plausible snippet.
+1. Visit your home page or any other page on your site where Plausible is installed.
+2. View the source code of your site. You can right-click anywhere on your page and click "**View Page Source**" (the wording may be slightly different depending on your web browser). Alternatively, use a keyboard shortcut to view the source code (`Option+Command+u` on a Mac or `ctrl+u` on Linux and Windows).
+3. Press `Command+f` on a Mac or `ctrl+f` on Linux and Windows to search the source code. Type `plausible.initp` to search for the Plausible snippet.
4. Do you see our snippet? Ensure that the snippet is correct and that there are no unintended modifications compared to the snippet we provided you with.
If you see our snippet in your source code and it is exactly the same snippet as the one we provided, it means Plausible is installed.
@@ -130,10 +124,10 @@ If you see our snippet in your source code and it is exactly the same snippet as
You can also use your browser's developer tools to look for the Plausible script or any errors related to your Plausible integration.
-1. Visit your home page or any other page on your site where Plausible is installed.
+1. Visit your home page or any other page on your site where Plausible is installed.
2. Right-click anywhere on your page and click "**Inspect**" (the wording may vary depending on your web browser) to open the developer tools. Alternatively, press the key `F12` on Firefox or Chrome or `Option+Command+i` on Safari.
3. Look into the "**Console**" tab in the developer tools for any errors related to Plausible. It may give you some insights into what's going on through the error code it provides. If you see an error related to the Plausible script, it means that something's not right with your implementation.
-4. Then click on the "**Network**" tab in the developer tools. It will be empty, so you would need to reload your page. After you refresh the page, you will start seeing some data in the "**Network**" tab. You should see the `script.js` script from the Plausible domain `plausible.io` in the list. The Plausible script should display status 200.
+4. Then click on the "**Network**" tab in the developer tools. It will be empty, so you would need to reload your page. After you refresh the page, you will start seeing some data in the "**Network**" tab. You should see the a script from the Plausible domain `plausible.io` in the list, starting with `pa-`. The Plausible script should display status 200.
diff --git a/docs/webflow-integration.md b/docs/webflow-integration.md
index 7f568e3f..7e5a341b 100644
--- a/docs/webflow-integration.md
+++ b/docs/webflow-integration.md
@@ -6,7 +6,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
Here's how to add Plausible Analytics to your Webflow site and set up the tracking of custom events such as button clicks and form submissions.
-## How to add Plausible to your Webflow website
+## How to add Plausible to your Webflow website
* On your project's page, click on the Webflow logo ("**W**") in the left-hand side menu and choose "**Project Settings**".
@@ -56,25 +56,17 @@ Your goal should now be set up. When you navigate back to your Plausible Analyti
## Tracking button clicks and other links on your Webflow site
-### 1. Enable "Custom events" for your site
+### 1. Set an ID to the element you want to track
-You can enable "**Custom events**" as an optional measurement when adding a new site to your Plausible account. If the site has already been added to your account, you can control what data is collected in the "**Site Installation**" area of the "**General** section in your [site settings](website-settings.md).
-
-### 2. Change the snippet on your site
-
-The tracking snippet changes depending on your selection of optional measurements. When making changes to your optional measurements, do ensure to insert the newest snippet into your site for all tracking to work as expected. We display your snippet during the process of adding a new site to your account. You can also see the snippet within the "**Site Installation**" area of the "**General** section in your [site settings](website-settings.md).
-
-### 3. Set an ID to the element you want to track
-
-In Webflow, link and button elements don't have a default ID. You'll need to assign an ID by selecting the element and clicking on the settings gear. In the **"Designer View"**, you'll be able to set the ID.
+In Webflow, link and button elements don't have a default ID. You'll need to assign an ID by selecting the element and clicking on the settings gear. In the **"Designer View"**, you'll be able to set the ID.
-### 4. Trigger custom events with JavaScript on your site
+### 2. Trigger custom events with JavaScript on your site
Here's the code you will need to insert in the `` section of the page where the element ID that you want to track is located. You can use the "**Custom Code**" feature to do this similarly to how you've inserted the Plausible snippet into your site.
-Make sure to change the `elementId` line in the code below to include the ID attribute of the element you want to track (`button-click` in our example).
+Make sure to change the `elementId` line in the code below to include the ID attribute of the element you want to track (`button-click` in our example).
Also do change the `classes` line to include the goal name in this format: `plausible-event-name=Goal+Name`. The goal name is completely up to you. It's the name under which the goal conversions will appear in your Plausible dashboard. We've used `Button+Click` goal name in our example.
@@ -106,11 +98,11 @@ For example: `plausible-event-name=Form+Submit` will display as `Form Submit` in
Do click on the "**Save Changes**" button and then "**Publish**" your changes.
-### 5. Create a custom event goal in your Plausible account
+### 3. Create a custom event goal in your Plausible account
When you send custom events to Plausible, they won't show up in your dashboard automatically. You'll have to configure the goal for the conversion numbers to show up.
-To configure a goal, go to [your website's settings](website-settings.md) in your Plausible account and visit the "**Goals**" section.
+To configure a goal, go to [your website's settings](website-settings.md) in your Plausible account and visit the "**Goals**" section.
Click on the "**+ Add goal**" button to go to the goal creation form. Select `Custom event` as the goal trigger and enter the name of the custom event you are triggering. The name must be an exact match to the one you added to your site for the conversions to show up in your dashboard.
@@ -118,9 +110,9 @@ So in our example where we added a goal name `plausible-event-name=Button+Click`
-Next, click on the "**Add goal**" button and you'll be taken back to the Goals page.
+Next, click on the "**Add goal**" button and you'll be taken back to the Goals page.
-### 6. Your goal should now be ready and tracking
+### 4. Your goal should now be ready and tracking
Your goal should now be set up. When you navigate back to your Plausible Analytics dashboard, you should see the number of visitors who triggered the custom event. Goal conversions are listed at the very bottom of the dashboard. The goal will show up in your dashboard as soon as it has been completed at least once.
@@ -133,11 +125,11 @@ If you want to trigger multiple custom events on the same site, you don't need t
var toTag = [
{
elementId: 'link-click',
- classes: 'plausible-event-name=Link+Click'
+ classes: 'plausible-event-name=Link+Click'
},
{
elementId: 'button-click',
- classes: 'plausible-event-name=Button+Click'
+ classes: 'plausible-event-name=Button+Click'
}
]
diff --git a/sidebars.js b/sidebars.js
index b24ae483..5b1bca21 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -96,16 +96,10 @@ module.exports = {
items: [
{ type: 'doc', id: 'proxy/guides/cloudflare', label: 'Cloudflare' },
{ type: 'doc', id: 'proxy/guides/wordpress', label: 'WordPress' },
- { type: 'doc', id: 'proxy/guides/fastly', label: 'Fastly' },
- { type: 'doc', id: 'proxy/guides/akamai', label: 'Akamai' },
- { type: 'doc', id: 'proxy/guides/netlify', label: 'Netlify' },
{ type: 'doc', id: 'proxy/guides/vercel', label: 'Vercel' },
- { type: 'doc', id: 'proxy/guides/nextjs', label: 'Next.js on Vercel' },
- { type: 'doc', id: 'proxy/guides/cloudfront', label: 'CloudFront' },
{ type: 'doc', id: 'proxy/guides/nginx', label: 'Nginx' },
{ type: 'doc', id: 'proxy/guides/caddy', label: 'Caddy' },
{ type: 'doc', id: 'proxy/guides/apache', label: 'Apache' },
- { type: 'doc', id: 'proxy/guides/deno', label: 'Deno Deploy' },
],
},
],
diff --git a/static/img/onboarding-enable-custom-events-tracking.png b/static/img/onboarding-enable-custom-events-tracking.png
deleted file mode 100644
index 7e4d2653..00000000
Binary files a/static/img/onboarding-enable-custom-events-tracking.png and /dev/null differ
diff --git a/static/img/onboarding-enable-custom-props.png b/static/img/onboarding-enable-custom-props.png
deleted file mode 100644
index d93e7e27..00000000
Binary files a/static/img/onboarding-enable-custom-props.png and /dev/null differ
diff --git a/static/img/onboarding-enable-hash-based-tracking.png b/static/img/onboarding-enable-hash-based-tracking.png
deleted file mode 100644
index 4060585f..00000000
Binary files a/static/img/onboarding-enable-hash-based-tracking.png and /dev/null differ
diff --git a/static/img/onboarding-enable-revenue-tracking.png b/static/img/onboarding-enable-revenue-tracking.png
deleted file mode 100644
index 9be69b0a..00000000
Binary files a/static/img/onboarding-enable-revenue-tracking.png and /dev/null differ