Skip to content

Commit

Permalink
fix: ensure trailing slash on matomo base url (#3)
Browse files Browse the repository at this point in the history
this ensures a trailing slash on the matomo base url, which is required
by the analytics script.
  • Loading branch information
stefanprobst authored Mar 16, 2024
2 parents 6c4dc46 + fd4b4d8 commit 170577e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ useHead({
isNonEmptyString(env.public.NUXT_PUBLIC_MATOMO_BASE_URL) &&
isNonEmptyString(env.public.NUXT_PUBLIC_MATOMO_ID)
) {
const baseUrl = env.public.NUXT_PUBLIC_MATOMO_BASE_URL;
scripts.push({
type: "",
innerHTML: createAnalyticsScript(
env.public.NUXT_PUBLIC_MATOMO_BASE_URL,
baseUrl.endsWith("/") ? baseUrl : baseUrl + "/",
env.public.NUXT_PUBLIC_MATOMO_ID,
),
});
Expand Down

0 comments on commit 170577e

Please sign in to comment.