Skip to content

Instantly share code, notes, and snippets.

@emaV
Last active August 29, 2015 14:20
Show Gist options
  • Save emaV/dc13ab6ced39f858cc64 to your computer and use it in GitHub Desktop.
Save emaV/dc13ab6ced39f858cc64 to your computer and use it in GitHub Desktop.
BOOMR addVar guid
var guid;
if(!BOOMR.utils.getCookie(impl.cookieName)) {
BOOMR.info("Could not find a cookie for " + impl.cookieName, "GUID");
guid = impl.generate();
if (!BOOMR.utils.setCookie(impl.cookieName,guid, impl.expires)) {
BOOMR.subscribe("before_beacon", function() {
BOOMR.utils.setCookie(impl.cookieName,guid, impl.expires);
});
}
BOOMR.info("Setting GUID Cookie value to: " + guid + " expiring in: " + impl.expires + "s", "GUID");
} else {
guid = BOOMR.utils.getCookie(impl.cookieName);
BOOMR.info("Found a cookie named: " + impl.cookieName + " value: " + guid, "GUID");
}
BOOMR.addVar({guid: guid});
return this;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment