File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type {} from 'nuxt/app'
33import type { ModuleOptions } from '../module'
44import { defineNuxtPlugin , useRuntimeConfig } from '#imports'
55import { init , track } from '@plausible-analytics/tracker'
6- import { joinURL } from 'ufo'
6+ import { joinURL , withLeadingSlash } from 'ufo'
77
88export default defineNuxtPlugin ( {
99 name : 'plausible' ,
@@ -17,9 +17,10 @@ export default defineNuxtPlugin({
1717
1818 init ( {
1919 domain : options . domain || window . location . hostname ,
20- endpoint : options . proxy
21- ? joinURL ( options . proxyBaseEndpoint , 'api/event' )
22- : joinURL ( options . apiHost , 'api/event' ) ,
20+ endpoint : joinURL (
21+ options . proxy ? withLeadingSlash ( options . proxyBaseEndpoint ) : options . apiHost ,
22+ 'api/event' ,
23+ ) ,
2324 autoCapturePageviews : options . autoPageviews ,
2425 hashBasedRouting : options . hashMode ,
2526 outboundLinks : options . autoOutboundTracking ,
You can’t perform that action at this time.
0 commit comments