@exodus/analytics
Advanced tools
Comparing version
@@ -18,3 +18,2 @@ import ExodusModule from '@exodus/module' | ||
#connected = false | ||
#anonymousId | ||
#installEventReportingUrl = null | ||
@@ -54,9 +53,8 @@ | ||
connect = (anonymousId) => { | ||
if (!anonymousId) { | ||
throw new Error('anonymousId not set') | ||
} | ||
this.#connected = true | ||
this.#anonymousId = anonymousId | ||
this.#tracker.setAnonymousId(anonymousId) | ||
if (anonymousId) { | ||
this.#tracker.setAnonymousId(anonymousId) | ||
} | ||
this.#sendPersistedEvents() | ||
@@ -72,3 +70,3 @@ this.#sendPersistedTrait() | ||
getAnonymousId = () => { | ||
return this.#anonymousId | ||
return this.#tracker.anonymousId | ||
} | ||
@@ -78,3 +76,3 @@ | ||
await fetchival(this.#installEventReportingUrl).post({ | ||
anonymousId: this.#anonymousId, | ||
anonymousId: this.getAnonymousId(), | ||
}) | ||
@@ -81,0 +79,0 @@ } |
{ | ||
"name": "@exodus/analytics", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "This library abstracts analytics reporting.", | ||
@@ -32,3 +32,3 @@ "files": [ | ||
}, | ||
"gitHead": "547b7ef51d92771d01cbbb89cc39def2440e581e" | ||
"gitHead": "5bfc6ae79b139dee7b652b82a580af518ded664f" | ||
} |
8784
-0.92%153
-1.92%