javascriptgoogle-analyticsexitgoogle-website-optimizer

GWO: Using trigger Exit page to start test variation


Our marketing team is asking if it is possible to run a test on our site where the variations are shown based on a page exit, versus a page load. I said I could try to see if I could handle it with custom code but I would love to use something already existing. I don't have the knowledge already to trigger a page exit myself and that's what I need to find out.

Scenario: The user would load the page, GWO would decide there which variation to show on load, and when the user "exits" then variation 1 would load a popup. The popup would have a link within it and conversion would be based on the user clicking the link. An exit would be defined here as anyone leaving the domain via the back button, closing the browser, or typing in another address into the address bar. An exit here is not specifically the page but the entire domain itself. Variation 1 of the test would only be served on roughly 10 pages (our of thousands on our retail site).

I somehow think that Google Analytics defines exit already and wonder if I couldn't piggy-bank that trigger? Does GWO have something similar? I don't think it's feasible or logical for our site to track if variation 1 user leaves the domain from any point, so perhaps only tracking exit if they were served variation 1 and only from the same page they got served variation 1.

So I know that's a loaded question, but has it been before within a test? Any easy way to handle it? Thanks in advance!


Solution

  • First off, giving a popup when a visitor is trying to leave your site is horrible UX. It is something that absolutely everybody hates, absolutely no exceptions, period. And...trying to find out which variation of an "exit link popup" works best is like trying to find out which method of torture people like most. So my very first advice to you is I strongly recommend you push back to your Marketing team about this, they should know better...if they are actually suggesting this then maybe they need to be (re)trained (or fired...) Just sayin'...

    But anyways... Ga officially states there is no auto-exit link tracking. I know that for the most part, GA determines exit links on current ping vs. next ping (or lack of), but my experience from poking at ga.js leads me to believe they do indeed to some degree have exit link / page unload tracking tucked away in there...

    But rather than trying to reverse engineer ga.js to see if it's even possible to tap into something that may or may not really be there, if you have jQuery or similar framework on your page (which most sites do, and if you don't, just include it on your test page(s) easy enough), you can use jQuery's .unload() to get it to trigger as you want.

    edit: One thing you said:

    An exit here is not specifically the page but the entire domain itself.

    Okay that's one "gotcha" that is not possible. You can write code to compare the current URL to the target URL if the visitor clicks on a link on your page, but javascript does not allow for you to access the new URL typed into the address bar, nor does it allow you to see the previous URL in the history (like if user clicks the back button) - both of these are browser security features - so there is no way for you to know 100% if the visitor is exiting your domain.

    Tracking tools like GA get around this for some of their data, by having a "session" timer keep track of last activity by the visitor. If the session times out, then the last ping submitted gets the extra data for exiting your site, like "last page of visit", bounce rate numbers, etc.. (though it will not show where the visitor actually went, for reasons listed above)