Skip to content

Commit 5e434dc

Browse files
authored
Update plugin.client.ts
1 parent 115d315 commit 5e434dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/runtime/plugin.client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type {} from 'nuxt/app'
22
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
33
import { createPlausibleTracker } from '@barbapapazes/plausible-tracker'
4+
import { withLeadingSlash } from 'ufo'
45

56
export default defineNuxtPlugin({
67
name: 'plausible',
@@ -14,7 +15,7 @@ export default defineNuxtPlugin({
1415
...options,
1516
logIgnored: options.logIgnoredEvents,
1617
domain: options.domain || window.location.hostname,
17-
apiHost: options.proxy ? options.proxyBaseEndpoint : options.apiHost,
18+
apiHost: options.proxy ? withLeadingSlash(options.proxyBaseEndpoint) : options.apiHost,
1819
})
1920

2021
return {

0 commit comments

Comments
 (0)