If you would like to target users based on the previous page they have visited, you can do so by using the document.referrer. You can add the document.refferrer for targeting by adding it as a Custom Variable to your Usabilla for Websites implementation.
Adding the document.referrer
Before getting started, first check with your Customer Success Manager to confirm your website does not block this functionality. The document.referrer, for example only works for multi-page websites, so this means that this does not work for Single Page Applications.
Why you should add the document.referrer
Why would you want to target users of the previous page? As possibilities are endless, here are just some of the things you can do with this targeting option.
- If the user is in the booking flow, then leaves and continues on the website. You could ask the reason why they left the booking flow, If they need help, or even offer a discount promotion code?
- If a user first visits a certain page then goes directly to the FAQ or Help Desk Page. You could ask if there was information missing on the page, or ask directly why they visited the FAQ page or Help Desk Page
- If you notice your user taking an alternative journey, you can notify them with a Recruit Participants campaign, and help redirect them to the right path.
How to set it up?
First, decide the page you want the campaign to show on and add it here.
Then decide on the page you want your user to come from (the previous page the user was on). This information is stored in the document.referrer variable.
Don’t forget to Save the changes you’ve made.