Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JS variable for the Clearbit-VWO integration
(function() {
if (!window.ClearBitAdded) {
window.ClearBitAdded = true;
var script = document.createElement('script');
script.src = "https://reveal.clearbit.com/v1/companies/reveal?authorization=paste_your_clearbit_key_here&variable=reveal_organization";
var event = new CustomEvent("ClearBitAdded", {
"detail": "ClearBitAdded"
});
script.onerror = function() {
console.log('VWO: Error Ocuured while fetching the clearbit data');
document.dispatchEvent(event);
};
script.onload = function() {
document.dispatchEvent(event);
};
document.getElementsByTagName('head')[0].appendChild(script);
return true;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment