Skip to main content

Pop-up triggers and conditions

Learn more about pop-up rules, how to trigger your pop-up and set the conditions that can show or hide your pop-up.

Written by Anders Lund

Rules and triggers

Rules determine where on your website a pop-up should be displayed.

To set your pop-up’s rules, you will define both triggers and conditions.

The most common rule is to trigger a pop-up when a specific URL is loaded.

Before setting up your conditions and triggers, think about how your pop-up should behave:

  • Which visitors should see the pop-up?

  • Are there any visitors who should not see the pop-up? How will you identify them?

  • Do you want to limit how many times someone will see the pop-up? Should the limit reset after a period of time?

  • Are there specific pages on your website where the pop-up should show?

  • Are there specific pages where it should be hidden?

  • If you have an e-commerce shop, should the contents of a shopping basket affect the pop-up’s visibility?

Triggers are what activate your pop-up.

Once all the conditions are met, the trigger will determine when to display the pop-up

Note: Some of the options listed here depend heavily on the capabilities of your website or CMS provider. Playable is unable to assist in evaluating these capabilities or determining which option is best for your scenario.

Trigger options

Pageload

The default trigger is page load. This means that if all conditions are met, the pop-up will show instantly when the webpage loads. To add a delay to your page load, you will add a trigger, select page load, and set a delay.

Exit Intent

This will display the pop-up when the user moves their mouse cursor up to the URL bar, which indicates that they will leave the webpage.

It's possible to set a delay on your exit intent trigger, though this is not recommended, as you usually want to display the pop-up as quickly as possible in order to catch the user's attention before they leave the page.

Scroll

This will display the pop-up when the user begins to scroll on the page. So if they open the page but don't scroll, the pop-up will not show, even if the conditions are met.

Data Layer Event

Data Layer is a feature of Google Tag Manager. You can read more about Data Layer here. You can also find more information about Data Layer events here.

If you use Data Layer events, you can use these events as pop-up triggers. In your trigger settings, you will give the event and variable names, and then define the condition for the trigger (based on the variable's value).

An example of a dataLayer trigger could be adding a winter related item to your basket:

Combining triggers

You can select more than one trigger for your campaign. In that case, all triggers have to be satisfied before the pop-up will show. So by combining scroll with exit intent, you can trigger an exit intent pop-up that will only show to users who have scrolled the page before leaving.

Note: it is not necessary to add "page load" as a second trigger because page load is the default trigger.

Conditions

There are ten different methods you can use as conditions, some are more advanced than others. The pop-up will only be displayed or hidden if all conditions are met!

URL address

Use the URL address condition to decide which pages on your website the pop-up shows on.

How to set it up

  1. Open your pop-up and go to Pop-Up Settings > Rules.

  2. Add a new condition.

  3. Under Type, choose URL address.

  4. Under Action, choose Show to display the pop-up on matching pages, or Hide to keep it off matching pages.

  5. Enter the address in the URL address field. To add more than one address, click Add URL.

  6. Click Save.

How the matching works

  • Enter the full address, including https://, for example https://example.dk/sport.

  • * is a wildcard and means "anything". You can put it at the start, in the middle or at the end of the address.

  • The check ignores everything after a ? and a / at the end of the address.

  • It isn't case-sensitive.

  • If your URL contains a URL parameter (e.g. ?newsletter=true), only add the base URL here and add the parameter as its own URL parameter condition.

Which URL to enter

Show the pop-up…

Action

URL address

On the front page only

Show

https://example.dk/

On every page except the front page

Show

https://example.dk/*

On the whole site

Show

https://example.dk*

On one page

Show

https://example.dk/sport

On a page and all its sub-pages

Show (two URLs, use Add URL)

https://example.dk/sport and https://example.dk/sport/*

Only on the sub-pages of a page

Show

https://example.dk/sport/*

On pages whose address contains a word

Show

*black-week*

On both www. and the plain domain

Show

*example.dk*

Everywhere except one page and its sub-pages

Hide

https://example.dk/kontakt and https://example.dk/kontakt/* (leave out the second URL to hide it on the page only)

Good to know

  • https://example.dk/* does not include the front page. This is the most common mistake. To include the front page, use https://example.dk*.

  • In the same way, https://example.dk/sport/* does not include the page /sport itself, only its sub-pages.

  • https://example.dk/sport* also matches https://example.dk/sports-news. To target a page and its sub-pages, use the two-URL version above.

  • https://www.example.dk* doesn't match https://example.dk (without www). If your site works with both, use *example.dk*.

  • With no URL address condition, the pop-up shows on every page of every site where your Playable script is installed.

  • An address ending in #something, such as https://example.dk/#top, doesn't match the front-page rule. To show or hide the pop-up based on a hashtag, use the Hashtag condition type.

URL parameter

Show or hide a pop-up based on your own URL parameters. An example of this could be if you link to your website from a newsletter with a URL like this: http://www.playable.com/?newsletter=true

The action is set to Hide, the parameter name is newsletter, the condition is set to equal and the value 'true', meaning that if the URL has newsletter in it the pop-up is hidden.

URL regex

Enter a custom regular expression to match against the URL. For example, to show a pop-up for all product categories other than “games”:

For more information on regex see our article here.

UTM parameter

If you add a UTM campaign source and UTM campaign name to match against, you can show or hide a pop-up based on these.

As an example, when a user visits from a URL which includes the following two parameters, utm_source and utm_campaign the action can be set to either Show or Hide the popup.

For more information on UTM parameters, see our article here.

Hashtag

Show or hide the pop-up depending on a specific hashtag. A hashtag comes at the end of the URL, add the text after #. For example:

Cookie

Show or hide a pop-up depending on the name of a cookie set in the browser. For example, if you have a cookie on your website with the name 'show_popup' with the value '1' then you could write the condition as follows:

DataLayer Variable

Show or hide the pop-up based on variables existing in the DataLayer object. Many websites publish in the DataLayer if a user is logged in. For example, a website might have a variable with the name 'loggedin' equal to '1'. Under the condition, you would write:

JS method

Show or hide a pop-up depending on a JavaScript evaluated on your website.

Function name: DisplayPopup

Code example:

window.DisplayPopup = function () {
return true;
};

When the condition is evaluated, it will execute the method and if the value returns true it will show the pop-up.

Display limit

You can limit how often a user will see the same pop-up. This is based on the user's browser cookies. Start by selecting a limit and then set an interval for how often the limit should reset.

Date range

There are three ways to control when your pop-up will be displayed:

  1. Under General settings, you can create a schedule to show the pop-up on certain days of the week and specific times of the day.

  2. Under the Campaign tab, you will set your pop-up’s campaign period (the first and last day it should be displayed).

  3. Under Conditions, you can add some extra date ranges during which you want to hide the pop-up.


We hope that this article has provided you with some clarity when it comes to pop-up rules, triggers and conditions. If you need further assistance, please reach out to our chat support!

Did this answer your question?