Google A/B testing with exit popup javascript

5 replies
Not sure if anyone is having the same challenges. I'd like to do an Google A/B test on two landing pages which both has an exit popup.

The main URL points to page A.

But whenever a user lands on the page and the websiteoptimizer selects the alternate page B, the exit popup shows up because the javascript thinks the user is leaving the page.

Obviously this looks very strange to the user.

So does anyone know how to work around this?

All comments and advice appreciated.
#a or b #exit #google #javascript #popup
  • Profile picture of the author johnnyN
    is it possible to tell your exit popup script to only popup if the exit url is not your domain?
    {{ DiscussionBoard.errors[4626756].message }}
    • Profile picture of the author Flareman
      Originally Posted by johnnyN View Post

      is it possible to tell your exit popup script to only popup if the exit url is not your domain?
      Unfortunately not. At least I don't see anywhere in the script that has that option. Heres the script:

      <!--New Exit popup-->
      <SCRIPT language="javascript">var PreventExitPop = false;function ExitPop() { if(PreventExitPop == false) { PreventExitPop=true; window.location="freebies.htm"; scroll(0, 0); return "***************************************\n\n W A I T! B E F O R E Y O U G O !\n\n Click *CANCEL* to get your FREEBIE\n\n Discover my secret to blahblahblah!\n\n CLICK THE [CANCEL] BUTTON RIGHT NOW...\n\n***************************************" } }window.onbeforeunload = ExitPop;</SCRIPT>

      Any ideas?
      {{ DiscussionBoard.errors[4627982].message }}
      • Profile picture of the author Flareman
        Any javascript experts here?
        {{ DiscussionBoard.errors[4628071].message }}
        • Profile picture of the author unnatural
          If you PM me the URL in question I can take a look, probably something simple, but hard to say without seeing how it's setup.
          {{ DiscussionBoard.errors[4628114].message }}
          • Profile picture of the author Flareman
            Originally Posted by unnatural View Post

            If you PM me the URL in question I can take a look, probably something simple, but hard to say without seeing how it's setup.
            Just did mate. Appreciate your help.
            {{ DiscussionBoard.errors[4628262].message }}

Trending Topics