Skip to content

Commit 17ec3d9

Browse files
committed
Update hash-based-routing docs
1 parent af0565b commit 17ec3d9

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

docs/hash-based-routing.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@ title: Hashed page paths
44

55
import useBaseUrl from '@docusaurus/useBaseUrl';
66

7-
If your site is using page paths with a `#` in the URL, you can use our "**Hashed page paths**" tracking to see the different pages your visitors have viewed.
7+
If your site is using page paths with a `#` in the URL, you can use our "**Hashed page paths**" tracking to see the different pages your visitors have viewed. Here's how to enable it:
88

9-
You can enable "**Hashed page paths**" tracking 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 how data is collected in the "**Site Installation**" area of the "**General**" section in your [site settings](website-settings.md).
9+
## Update your snippet
1010

11-
<img alt="Enable hashed page paths tracking during onboarding" src={useBaseUrl('img/onboarding-enable-hash-based-tracking.png')} />
11+
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).
12+
13+
Update the snippet to pass the following argument to `plausible.init`:
14+
15+
```javascript
16+
plausible.init({
17+
hashBasedRouting: true
18+
})
19+
```
20+
21+
Your Plausible tracking snippet should be inserted into [the Header (`<head>`) section of your site](plausible-script.md). Place the tracking script within the `<head> … </head>` tags.
1222

1323
After you change the tracking snippet on your site, all the hash-based page paths will start being tracked and will be displayed in the "**Top Pages**" report of your Plausible Analytics dashboard.

docs/script-update-guide.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,19 @@ plausible.init({
6767

6868
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
6969

70-
### 6. Changed: Tracking pageviews manually
70+
### 6. Changed: Hashed page paths
71+
72+
If you were previously using a hash based routing and had a `.hash` in your script path, you will need to set `hashBasedRouting` option:
73+
74+
```javascript
75+
plausible.init({
76+
hashBasedRouting: true
77+
})
78+
```
79+
80+
See also [Hashed page paths guide](/hash-based-routing.md)
81+
82+
### 7. Changed: Tracking pageviews manually
7183

7284
If you were previously using the `manual` extension to track pageviews manually, you will need to set `autoCapturePageviews` option to `false`:
7385

@@ -79,7 +91,7 @@ plausible.init({
7991

8092
See also [Custom locations guide](/custom-locations).
8193

82-
### 7. Changed: Tracking on localhost
94+
### 8. Changed: Tracking on localhost
8395

8496
If you were previously using `local` extension to track events on localhost, you will need to set `captureOnLocalhost` option to `true`:
8597

@@ -89,16 +101,16 @@ plausible.init({
89101
})
90102
```
91103

92-
### 8. Changed: Custom events and revenue features are automatically enabled
104+
### 9. Changed: Custom events and revenue features are automatically enabled
93105

94106
If you were already using these features, no additional steps are required. Documentation links:
95107
- [Custom events](/custom-event-goals)
96108
- [Ecommerce revenue and attribution tracking](docs/ecommerce-revenue-tracking.md)
97109

98-
### 9. Removed: `data-exclude`
110+
### 10. Removed: `data-exclude`
99111

100112
The new script no longer supports the `data-exclude` and `data-include` attributes. See [alternative guide](/excluding.md) instead.
101113

102-
### 10. Removed: multiple domain support
114+
### 11. Removed: multiple domain support
103115

104116
The new script does not support sending stats to multiple dashboards at once anymore. Keep using the old script for this functionality.
Binary file not shown.

0 commit comments

Comments
 (0)