Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Added error handling for JSON.parse
perso182109e8d6d31cb
diff --git a/src/tracker/index.js b/src/tracker/index.jsindex 2f0fe8267..fa5a30e9d 100644--- a/src/tracker/index.js+++ b/src/tracker/index.js@@ -233,7 +233,12 @@};const track = (obj, data) => {- const identity = JSON.parse(localStorage.getItem('umami.identity'));+ let identity;+ try {+ identity = JSON.parse(localStorage.getItem('umami.identity'));+ } catch (error) {+ identity = null;+ }if (typeof obj === 'string') {return send({...getPayload(),