📎 Add more events instrumentation

This commit is contained in:
Andrey Antukh 2022-03-21 15:00:50 +01:00 committed by Andrés Moya
parent bf6211903c
commit 8acc9af1f5
10 changed files with 216 additions and 189 deletions

View file

@ -34,6 +34,20 @@
(yrq/get-header request "x-real-ip")
(yrq/remote-addr request)))
(defn extract-utm-params
"Extracts additional data from params and namespace them under
`penpot` ns."
[params]
(letfn [(process-param [params k v]
(let [sk (d/name k)]
(cond-> params
(str/starts-with? sk "utm_")
(assoc (->> sk str/kebab (keyword "penpot")) v)
(str/starts-with? sk "mtm_")
(assoc (->> sk str/kebab (keyword "penpot")) v))))]
(reduce-kv process-param {} params)))
(defn profile->props
[profile]
(-> profile