2014-06-15 17:19:37 -04:00
|
|
|
module.exports = initializeSegmentio = ->
|
|
|
|
analytics = analytics or []
|
|
|
|
(->
|
|
|
|
e = [
|
|
|
|
"identify"
|
|
|
|
"track"
|
|
|
|
"trackLink"
|
|
|
|
"trackForm"
|
|
|
|
"trackClick"
|
|
|
|
"trackSubmit"
|
|
|
|
"page"
|
|
|
|
"pageview"
|
|
|
|
"ab"
|
|
|
|
"alias"
|
|
|
|
"ready"
|
|
|
|
"group"
|
|
|
|
]
|
|
|
|
t = (e) ->
|
|
|
|
->
|
2014-06-16 06:55:58 -04:00
|
|
|
analytics.push [e].concat(Array::slice.call(arguments, 0))
|
2014-06-15 17:19:37 -04:00
|
|
|
return
|
|
|
|
|
|
|
|
n = 0
|
|
|
|
|
|
|
|
while n < e.length
|
|
|
|
analytics[e[n]] = t(e[n])
|
|
|
|
n++
|
|
|
|
return
|
|
|
|
)()
|
|
|
|
analytics.load = (e) ->
|
|
|
|
t = document.createElement("script")
|
|
|
|
t.type = "text/javascript"
|
|
|
|
t.async = not 0
|
|
|
|
t.src = ((if "https:" is document.location.protocol then "https://" else "http://")) + "d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/" + e + "/analytics.min.js"
|
|
|
|
|
|
|
|
n = document.getElementsByTagName("script")[0]
|
|
|
|
n.parentNode.insertBefore t, n
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
analytics.load "jsjzx9n4d2"
|