Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

added hash & search based routing docs

Blue Mouse7ab84ba29765
diff --git a/docs/script-reference.md b/docs/script-reference.md
index 94840d853..faa3484a1 100644
--- a/docs/script-reference.md
+++ b/docs/script-reference.md
@@ -85,6 +85,8 @@ swetrix.trackViews({
heartbeatOnBackground: false,
noUserFlow: false,
doNotAnonymise: false,
+ hash: false,
+ search: false,
})
```
@@ -96,6 +98,8 @@ swetrix.trackViews({
| heartbeatOnBackground | Send Heartbeat requests when the website tab is not active in the browser.<br />Setting this to `true` means that users who opened your website in inactive browser tab or window will not be counted into users realtime statistics.<br />Setting this to true is usually useful for services like Spotify or Youtube. | `false` |
| noUserFlow | Send previous page user visited to the server, only the pages on your website will be sent. Setting this to `true` means that no user flow analytics will be sent and as a consequence it won't be available to you later in Dashboard. | `false` |
| doNotAnonymise | Do not send paths from ignore list to API. If set to `false`, the page view information will be sent to the Swetrix API, but the page will be displayed as a 'Redacted page' in the dashboard. | `false` |
+| hash | Set to `true` to enable hash-based routing. For example if you have pages like `/#/path` or want to track pages like `/path#hash`. | `false` |
+| search | Set to `true` to enable search-based routing. For example if you have pages like `/path?search`. Although it's not recommended in most cases, you can set both `hash` and `search` to `true` at the same time, in which case the pageview event will be fired when either the hash or the search part of the URL changes (again, both the hash and the search are sent to the server). | `false` |
The `trackViews` function returns a `Promise` with an object with some methods allowing you to alter the behaviour of page tracking:
```javascript
@@ -103,4 +107,4 @@ The `trackViews` function returns a `Promise` with an object with some methods a
// This function stops the tracking of pages.
stop() {},
}
-```
\ No newline at end of file
+```