Skip to content

Instantly share code, notes, and snippets.

@jakebellacera
jakebellacera / floodlight-click-handler.js
Last active June 26, 2019 21:31
Floodlight click handler
document.getElementById("button").addEventListener("click", function(e) {
e.preventDefault();
var url = this.getAttribute("href", 2);
createFloodlightTag("source", "type", "cat", function() {
window.location = url; // Redirect the user after the tag successfully fires
});
});
function createFloodlightTag(source, type, cat, callback) {