Last active
December 8, 2019 15:31
-
-
Save andrewsuzuki/fd9edda14296fd03483b0dbe40ee3a99 to your computer and use it in GitHub Desktop.
clojurescript google analytics autotrack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns MY_NAMESPACE.analytics | |
(:require [cljsjs.google-analytics] | |
[autotrack])) | |
(def tracking-code "UA-XXXXX-Y") | |
(defn start [] | |
(js/ga "create" tracking-code "auto") | |
(js/ga "require" "autotrack") | |
(js/ga "send" "pageview")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Analytics | |
;; lein | |
[cljsjs/google-analytics "2015.04.13-0"] | |
;;; Autotrack | |
;; npm install --save autotrack | |
;; then add the following compiler option into relevant build configurations | |
:foreign-libs [{:file "node_modules/autotrack/autotrack.js" | |
:provides ["autotrack"]}]}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment