Skip to content

Commit

Permalink
Use blob to set analytics beacon content type
Browse files Browse the repository at this point in the history
  • Loading branch information
dashdashzako committed Oct 16, 2019
1 parent 3a985dc commit 9491f22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/middleware/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ const analytics: Middleware = (store) => (next) => (
console.log(strData);
} else {
const loggerEndpoint = (window as any).loggerEndpoint;
const blob = new Blob([strData], {
type: 'application/json; charset=UTF-8'
});

if (loggerEndpoint) {
navigator.sendBeacon(loggerEndpoint, strData);
navigator.sendBeacon(loggerEndpoint, blob);
}
}
}
Expand Down

0 comments on commit 9491f22

Please sign in to comment.