Skip to content

Commit

Permalink
Adding support for hash based routing
Browse files Browse the repository at this point in the history
  • Loading branch information
4lejandrito committed Aug 21, 2023
1 parent 6bf6f5e commit e27f26c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default function RootLayout({ children }) {
| `manualPageviews` | Set this to `true` if you want to disable [automatic pageview events](https://plausible.io/docs/script-extensions#plausiblemanualjs). |
| `pageviewProps` | Set the [custom properties for pageviews](https://plausible.io/docs/custom-pageview-props). The `event-` prefix will be added automatically. See [an example](test/page/pages/pageViewPropsAsObject.js). |
| `revenue` | Set this to `true` if you want to enable [ecommerce revenue tracking](https://plausible.io/docs/ecommerce-revenue-tracking). |
| `hash` | Set this to `true` if you want to [use hash-based routing](https://plausible.io/docs/hash-based-routing). |
| `exclude` | Set this if you want to exclude a set of pages from being tracked. See https://plausible.io/docs/excluding-pages for more details. |
| `selfHosted` | Set this to `true` if you are self hosting your Plausible instance. Otherwise you will get a 404 when requesting the script. |
| `enabled` | Use this to explicitly decide whether or not to render script. If not passed the script will be rendered in production environments. |
Expand Down
4 changes: 4 additions & 0 deletions lib/PlausibleProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default function PlausibleProvider(props: {
* Set this to true if you want to track ecommerce revenue as described in https://plausible.io/docs/ecommerce-revenue-tracking .
*/
revenue?: boolean
/**
* Set this to true if you want to use hash-based routing as described in https://plausible.io/docs/hash-based-routing.
*/
hash?: boolean
/**
* Set this to true if you want to enable localhost tracking as described in https://plausible.io/docs/script-extensions.
*/
Expand Down
1 change: 1 addition & 0 deletions lib/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const allModifiers = [
'tagged-events',
'pageview-props',
'revenue',
'hash',
] as const

export type ScriptModifier = typeof allModifiers[number]
Expand Down

0 comments on commit e27f26c

Please sign in to comment.