measurement-framework
Version:
Collection of Javascript code to implement a browser based measurement system for websites. It uses a cookie to store a users action on a webpage and let you map thoose actions to a particular state in the user journey.
13 lines (11 loc) • 378 B
JavaScript
import window from "window"
import isFunction from "lodash-es/isFunction"
import gaHostname from "./gaHostname"
const gaCookieDomain = function () {
let cookieDomain = gaHostname()
if (isFunction(window.ga) && isFunction(window.ga.getAll)) {
cookieDomain = window.ga.getAll()[0].get("cookieDomain")
}
return cookieDomain
}
export default gaCookieDomain