Skip to content

Instantly share code, notes, and snippets.

@kerminz
Last active February 3, 2020 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerminz/b8c3cd9dd5840542e2c293936f7a521f to your computer and use it in GitHub Desktop.
Save kerminz/b8c3cd9dd5840542e2c293936f7a521f to your computer and use it in GitHub Desktop.
AB Rocket Onboarding Example Experiment
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