Skip to content

Commit

Permalink
fix: wrong analytics url hosting on subpath (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikWempe authored May 6, 2024
1 parent 45de5a1 commit 9b14f54
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ export const Analytics = () => {
let hasSentBeacon = false;
try {
if (navigator.sendBeacon) {
hasSentBeacon = navigator.sendBeacon(`/api/analytics`, blob);
hasSentBeacon = navigator.sendBeacon(`${BASE_PATH}/api/analytics`, blob);
}
} catch (error) {
// do nothing; in case there is an error we fall back to fetch
}

if (!hasSentBeacon) {
fetch(`/api/analytics`, {
fetch(`${BASE_PATH}/api/analytics`, {
method: 'POST',
body: blob,
credentials: 'omit',
Expand Down

0 comments on commit 9b14f54

Please sign in to comment.