Fix DNT logic
This commit is contained in:
parent
4c57c37c00
commit
242d991b0c
@ -17,7 +17,7 @@
|
|||||||
(defn init-amplitude
|
(defn init-amplitude
|
||||||
"Injects the Amplitude bootstrapping script if DNT is disabled"
|
"Injects the Amplitude bootstrapping script if DNT is disabled"
|
||||||
[]
|
[]
|
||||||
(when (not (do-not-track))
|
(when-not (do-not-track)
|
||||||
(dom/appendChild (.-body (dom/getDocument))
|
(dom/appendChild (.-body (dom/getDocument))
|
||||||
(dom/createDom "script" nil amplitude-init-code))
|
(dom/createDom "script" nil amplitude-init-code))
|
||||||
(go (let [user-id (-> js/browser
|
(go (let [user-id (-> js/browser
|
||||||
@ -31,7 +31,7 @@
|
|||||||
"Logs an event to Amplitude. Returns a channel that resolves with the response from Amplitude"
|
"Logs an event to Amplitude. Returns a channel that resolves with the response from Amplitude"
|
||||||
([event-name properties]
|
([event-name properties]
|
||||||
(let [res-channel (chan)]
|
(let [res-channel (chan)]
|
||||||
(when (not (nil? js/amplitude))
|
(when (and (not (do-not-track)) (exists? js/amplitude))
|
||||||
(.logEvent (.getInstance js/amplitude)
|
(.logEvent (.getInstance js/amplitude)
|
||||||
event-name
|
event-name
|
||||||
(clj->js properties)
|
(clj->js properties)
|
||||||
|
Loading…
Reference in New Issue
Block a user