Do you want to display a popup to the visitors who saw page X on your website? In this article, we'll explain how, using custom properties.

Retarget the visitors of one unique page

Step 1: Add the script

Paste the following script right before the </script> tag of your WisePops tracking code.

if (window.location.pathname === '/path/to/pageX/') {
    wisepops('properties', {
        pageX: new Date()
    });
}

Replace 

'/path/to/pageX/'

by the path of your own page.

You can also replace pageX by any name you'd like.

Here's an example on our own website. We want to retarget the users who saw our pricing page. The URL of this page is: https://wisepops.com/pricing/.

This is what the script will look like for me:

if (window.location.pathname === '/pricing/') {
    wisepops('properties', {
        PricingPage: new Date()
    });
}


And this is what the result will look like in Google Tag Manager:

Check this guide to help you test the custom property.

Step 2: Add a condition to your display scenario

Open your popup in the editor.
In the left menu, click "Display" and then select "Custom properties".
Click "Add rule", paste the name of your page and select the condition "Is before", then "Time frame", 1 min ago. 


For me, the condition would be:

You can also adjust the time frame. For example, I could display the popup to the visitors who visited our pricing page more than 14 days ago:

Retarget the visitors of two or more pages


You can also adapt the script to target multiple pages:

if (window.location.pathname === '/path/to/pageX') {
    wisepops('properties', {
        pageX: new Date()
    });
} else if (window.location.pathname === '/path/to/pageY') {
    wisepops('properties', {
        pageY: new Date()
    });
}

Feel free to contact our team if you have any questions :)

Did this answer your question?