Dec 15

Coding The Perfect Exit Console

One thing I have found that improves conversions on any funnel (squeeze) page is the use of an exit console. An exit console will ‘pop’ a little window if/when a surfer goes to leave your page before entering in their email, with another offer. This increases your chances of getting them to opt in to one of your lists.

So how do we do it? This may seem a bit long winded at first but trust me the instructions are pretty simple once you get your head round it. Feel free to get in touch if you are having any problems.

Copy paste the following code in blue into your html page, in between the <head> and </head> tags.

<script language=”javascript”>
(function() {
setTimeout(function() {
var __redirect_to = ‘http://www.yourofferurlgoeshere.com’;//
var _tags = [‘button’, ‘input’, ‘a’], _els, _i, _i2;
for(_i in _tags) {_els = document.getElementsByTagName(_tags[_i]);
for(_i2 in _els) {if((_tags[_i] == ‘input’ && _els[_i2].type != ‘button’ && _els[_i2].type != ‘submit’ && _els[_i2].type != ‘image’) || _els[_i2].target == ‘_blank’) continue;_els[_i2].onclick = function() {window.onbeforeunload = function(){};}}}
window.onbeforeunload = function() {
setTimeout(function() {window.onbeforeunload = function() {};setTimeout(function() {document.location.href = __redirect_to;}, 500);},5);return ‘**********************************\nHold On A Minute There Cowboy!!**********************************\n\nClick *CANCEL* Or *STAY ON THIS PAGE*\nTo Take Advantage Of This Amazing Offer :\n\nGet 3 FREE Email List Building Ebooks!\nYours Today for $0 – Absolutely FREE!\n\n**********************************\n’;}}}, 500);})();</script>

Before we go any further – you are going to need to edit certain parts of the above code.

1) Substitute http://www.yourofferurlgoeshere.com for the url you wish to send your exits to.

2) This exit console is set up for me giving away 3 free E-books, so you will most likely want to personalise the message to suit your offer. The code below is for the text that comes up in the exit pop…

‘**********************************\nHold On A Minute There Cowboy!!**********************************\n\nClick *CANCEL* Or *STAY ON THIS PAGE*\nTo Take Advantage Of This Amazing Offer :\n\nGet 3 FREE Email List Building Ebooks!\nYours Today for $0 – Absolutely FREE!\n\n**********************************\n

will produce an exit window like so :

exitpop

So you can see roughly from the blue text above what does what in the exit pop up.
NB : \n is a line break – and you can work the rest out on your own I’m sure 🙂
If/when the surfer clicks ‘Stay on this Page’ they get redirected to the url as specified in 1)

Ok we aren’t done yet. What you really want is for the console NOT to pop if the surfer enters their email into your funnel and opts in. We get this to work by editing our Aweber code like so :

aweber1

Choose the Raw HTML Version and you will see the following :

aweber2

I  copy paste all of this code into a notepad file so I can edit it easily.
You are only looking for one line anyway – which is this one :

<input name=”submit” type=”submit” value=”Submit” tabindex=”502″ />

Your code may be slightly different if you have used a custom button, but you need the full line that starts with  <input name=”submit”…… This is the only line of text that needs editing. Next we need a command that will tell the page NOT to pop an exit console if the surfer opts in – which is this :

onclick=”exit=false”

Added to the end of your line of code from Aweber, we end up with the following :

<input name=”submit” type=”submit” value=”Submit” tabindex=”502″ onclick=”exit=false” />

Ok you’re done 🙂 Paste the Aweber code into your webpage, upload, test, and you are ready to go.

I uploaded a page where you can see this in action – click here to get to that 🙂

This console is tested and working in Chrome, IE, Safari and Firefox.
NB : the custom exit pop up window does not come up in Firefox, instead it only displays the following :

firefoxpop

The functionality works just fine though.
Thanks go to Zeid Makkawi from the Solo Swap Syndicate Facebook group for providing me with some of the original code, then I got in and worked the rest out with the power of Google 🙂