Google A/B testing with exit popup javascript

by 5 replies
6
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.
#programming #a or b #exit #google #javascript #popup
  • is it possible to tell your exit popup script to only popup if the exit url is not your domain?
    • [1] reply
    • 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?
      • [1] reply

Next Topics on Trending Feed