From 75e386e0ee0109a77caf924aa231813721dbb4e6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 29 May 2017 14:56:41 +0100 Subject: [PATCH] fix async behaviour, tracking should maybe use Async Piwik tracker events before piwik loads are lost currently blocking for piwik would be stupid. Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/Analytics.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Analytics.js b/src/Analytics.js index a660a214c7..112d7ab58c 100644 --- a/src/Analytics.js +++ b/src/Analytics.js @@ -32,9 +32,7 @@ class Analytics { * otherwise try and initalize, no-op if piwik config missing */ enable() { - if (this.tracker || this._init()) { - this.disabled = false; - } + if (!this.tracker) this._init(); } /** @@ -71,6 +69,7 @@ class Analytics { } _set(tracker) { + this.disabled = false; this.tracker = tracker; this.tracker.discardHashTag(false); this.tracker.enableHeartBeatTimer();