You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/custom-query-params.md
+13-42Lines changed: 13 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,31 +8,23 @@ Other than the source attribution query parameters listed above, Plausible strip
8
8
9
9
If you still want some pages to be reported with the complete URL that includes the query part, here's what you should do:
10
10
11
-
## 1. Add the `manual` script extension
11
+
## 1. Disable automatic pageviews
12
12
13
-
You can use Plausible's manual script extension and define a custom location for all such pageviews.
13
+
To specify a custom location for your event, you must disable automatic pageview tracking. Update your snippet to set `autoCapturePageviews` to `false`.
14
14
15
-
To do so, change your Plausible script snippet `src` attribute from `https://plausible.io/js/script.js` to `https://plausible.io/js/script.manual.js`.
16
-
17
-
The new snippet will look like this (make sure to change the `data-domain` attribute to the domain you added to your Plausible account):
Do this on all the pages where you want to track the custom query parameters.
23
20
24
-
## 2. Trigger the pageview event with a custom `u` attribute
21
+
Do this on all the pages where you want to track the custom query parameters.
25
22
26
-
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.
23
+
## 2. Trigger the pageview event with a custom `url` attribute
27
24
28
-
To trigger events manually, you need to add the following script after your regular Plausible tracking snippet:
25
+
Once you've disabled `autoCapturePageviews` 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.
29
26
30
-
```html
31
-
<!-- define the `plausible` function to manually trigger events -->
The `+ window.location.search` is needed to persist source acquisition query parameters from your actual URL. Plausible uses `ref`, `source`, `utm_source`, `utm_medium`, `utm_campaign`, `utm_content` and `utm_term` query parameters for source acquisition.
87
58
:::
88
59
89
-
That's it! You're now tracking the complete URLs of the pages that include custom parameters.
60
+
That's it! You're now tracking the complete URLs of the pages that include custom parameters.
0 commit comments