AB Split Test setup for UABB Modal Automatic pop-ups

Avatar

By Tom C

updated 8 days ago

As of version 1.0.3, you can use this guide to selectively trigger UABB modals, when it's AB test variation is displayed.

Watch the below video for steps, and the code needed is below that.

Any questions, hit us up on chat and we'll give you a hand.

How To Video

Code you'll need

Modal trigger Class and/or ID

Found at Modal > Display Settings > Display Modal On (Custom Class / ID) > Custom Class and/or ID

.ab-split-test-trigger

HTML MODULE CONTENT

<!-- AB SPLIT TEST SCRIPT TO TRIGGER MODAL AUTOMATICALLY, WHEN THIS VARIATION IS DISPLAYED -->
<!-- SEE KNOWLEDGEBASE FOR MORE -->
<!-- https://help.absplittest.com/article/45-ab-split-test-setup-for-uabb-modal-automatic-pop-ups -->
<!-- NOTE, SET UP THE AB TEST ON THIS HTML MODULE, NOT THE UABB MODAL MODULE. Go to Advanced > AB Split Test --> 
<div class="ab-split-test-trigger"></div>
<script>
    jQuery(document).ready(function(){
        jQuery('body').bind('ab-test-setup-complete', function() { 
            // if the empty div we created above is visible, then AB test has displayed it, so we should trigger the modal.
           jQuery('.ab-split-test-trigger:visible').click();
        });
    });
</script>

Things to note / troubleshooting

  1. This is only for UABB AUTOMATIC pop ups. If your modals are triggered in another way, then you can ignore this article.
  2. Do not apply an AB test to the modal itself. You want to AB test on the HTML modulethat is controlling the modal.
    1. After you paste in the code, go to the HTML modules Advanced tab, then scroll to AB test section and tag the test as usual.
  3. This only works as of version 1.0.3 - released 17 June 2020.



Did this answer your question?