Skip to content

Commit 9b14f54

Browse files
authored
fix: wrong analytics url hosting on subpath (#21)
1 parent 45de5a1 commit 9b14f54

File tree

1 file changed

+2
-2
lines changed
  • packages/blog-starter-kit/themes/enterprise/components

1 file changed

+2
-2
lines changed

packages/blog-starter-kit/themes/enterprise/components/analytics.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ export const Analytics = () => {
159159
let hasSentBeacon = false;
160160
try {
161161
if (navigator.sendBeacon) {
162-
hasSentBeacon = navigator.sendBeacon(`/api/analytics`, blob);
162+
hasSentBeacon = navigator.sendBeacon(`${BASE_PATH}/api/analytics`, blob);
163163
}
164164
} catch (error) {
165165
// do nothing; in case there is an error we fall back to fetch
166166
}
167167

168168
if (!hasSentBeacon) {
169-
fetch(`/api/analytics`, {
169+
fetch(`${BASE_PATH}/api/analytics`, {
170170
method: 'POST',
171171
body: blob,
172172
credentials: 'omit',

0 commit comments

Comments
 (0)