Last active
February 3, 2020 19:10
-
-
Save kerminz/b8c3cd9dd5840542e2c293936f7a521f to your computer and use it in GitHub Desktop.
AB Rocket Onboarding Example Experiment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var banner_bottom = '<div class="banner-bottom">'+ | |
' <div class="banner-bottom-content">'+ | |
' <span>Lorem Ipsum Dolor!</span>'+ | |
' <a class="c-btn" target="_blank" href="https://www.google.com" title="Click me">CLICK ME!</a>'+ | |
' </div>'+ | |
' <div class="banner-close">'+ | |
' x'+ | |
' </div>'+ | |
'</div>'; | |
abrocket.API.whenConditionIsMet(function() { | |
return jQuery !== undefined && !!document.querySelector('body') | |
}, function() { | |
if (!abrocket.API.getCookie('k-banner-bottom-close')) { | |
jQuery(banner_bottom).insertBefore('body'); | |
document.querySelector('.banner-bottom-content > a').addEventListener('click', function() { | |
//abrocket.API.pushGoal('YOUR_GOAL_ID') | |
}) | |
jQuery('.banner-close').on('click', function() { | |
abrocket.API.setCookie('k-banner-bottom-close', true, 30) | |
document.querySelector('.banner-bottom').style.display = "none" | |
}) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment