Skip to content

Instantly share code, notes, and snippets.

@thedavidmeister
Last active December 5, 2016 13:03
Show Gist options
  • Save thedavidmeister/d5e682722dd5d4689af424819d4432e5 to your computer and use it in GitHub Desktop.
Save thedavidmeister/d5e682722dd5d4689af424819d4432e5 to your computer and use it in GitHub Desktop.
calq embed snippet sans script tags, DOM manipulation and init/track calls
(function (e, t) { if (!t.__SV) { window.calq = t; t.init = function (e, o) { if (t.writeKey) return; t.writeKey = e; t._initOptions = o; t._execQueue = []; var m = "action.track action.trackSale action.trackHTMLLink action.trackPageView action.setGlobalProperty user.profile user.identify user.clear".split(" "); for (var n = 0; n < m.length; n++) { var f = function () { var r = m[n]; var s = function () { t._execQueue.push({ m: r, args: arguments }) }; var i = r.split("."); if (i.length == 2) { if (!t[i[0]]) { t[i[0]] = [] } t[i[0]][i[1]] = s } else { t[r] = s } }(); } }; t.__SV = 1 } })(document, window.calq || []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment