Conditions Introduction

Article Table of Contents


Introduction

You can use Popup Maker targeting conditions to refine where you want your popup to appear. Targeting conditions are the rules that control which posts and pages a popup should get loaded for triggering. The combination of loading a popup into the browser and triggering the popup to launch is how Popup Maker displays popups.

You can set up conditions under Popup Settings >  Targeting.

Popup targeting conditions are set in one of two ways:

  • Always On ( plugin default ):  By default, the plugin preloads a published popup in the browser on every page and post of a site. This ensures that whichever popup trigger is selected in the Popup Editor, a popup will always be ready to display in the browser. When a plugin user accepts the default targeting settings, the plugin loads a popup to appear on the largest possible set of published posts and pages.
  • Targeted: You can choose a select set of conditions that targets the posts and pages on which a popup will display.

This article explains how to set specific, content-based targeting conditions using the plugin's default standard targeting conditions. Additional targeting conditions specific to the WooCommerce or BuddyPress plugins become available when those plugins are activated with Popup Maker.

Non-content-based targeting conditions are available by installing the Advanced Targeting Conditions (ATC) plugin extension to Popup Maker

Related index page:  Advanced Targeting Conditions Introduction

Related article:  WooCommerce Conditions

Related article:  BuddyPress Conditions

[ Back to top ]


Set A Targeting Condition

Add a Condition with the Targeting Selector

To target either a segment of your site content or specific non-content-based conditions for popup loading, use the drop-down menu selector at Popup Settings > Targeting (identified by the purple arrow above).  This selector menu offers all of the plugin's standard (content-based) targeting conditions, plus any additional conditions provided by other plugins ( Popup Maker's Advanced Targeting Conditions extension, WooCommerce, etc ).  

[ Back to top ]


Target a Single Condition ( Simplest Use Case )

Targeting conditions are simply conditional sentences using 'if' and 'then' clauses.  When the 'if' clause is true, a specific result is expected. The following sentence contains an 'if/then' clause that refers to a single published page.

If a visitor opens a published page with the title 'Our Services',  then activate the popup named 'Newsletter Signup'. 

In the Popup Editor, the single targeting condition described above is shown in the following screenshot:

[ Back to top ]


Target Two or More Conditions

Most people however typically target two or more elements within the same content type for popup loading. Examples could include: 

  • two or more pages (selected by page title), 
  • two or more posts (selected by post title or ID number), or
  • two or more post categories.

Or they target two or more conditions that mix standard and advanced targeting conditions.

How should those targeting conditions be setup in the Popup Editor?

[ Back to top ]


Target Using an 'OR' Operator 

Use the 'OR' operator to target the largest set of possible conditions for popup loading.

When targeting two or more conditions, select the  'OR' operator to link each condition.  An 'OR' operator requires that only one of the conditions be true at any one time to return the intended result. Additional 'OR' conditions can be added in Popup Settings > Targeting by simply clicking on the term '+ OR'.

In the following example, two content types are targeted to load a popup: 

  • 'Page: Selected' -> 'Our Services', or
  • 'Post: Selected' -> 'Choosing a Contractor'. 

A conditional statement targeting this content could be written as:

If a visitor opens a published page with the title 'Our Services' OR a published post with the title 'Choosing a Contractor', then load a popup named 'Newsletter Signup'. 

The logic of this statement makes sense. When either the page 'Our Services' OR the post 'Choosing a Contractor' appears in the browser, the popup gets loaded. 

In the Popup Editor, the targeting conditions are shown in the following screenshot:

[ Back to top ]

As a second example, let's change the post 'Choosing a Contractor' to a 'page' content type. Now two pages ( 'Our Services' and 'Choosing a Contractor' ) are targeted and can be stated in the same conditions field. The targeting condition implies the use of an 'OR' operator. If either page, 'Our Services' OR 'Choosing A Contractor' is opened in the browser (returns TRUE), a popup will load. 

The same targeting condition could be set in the Popup Editor using an explicit 'OR' operator as shown in the screenshot below.

Both targeting conditions are equivalent.

Tip: When setting 3 or more conditions that include the same content type, use an 'OR' operator to separately state each condition.   It's easier to read, and can assist with troubleshooting should a problem later arise with a popup.

[ Back to top ]


Target Using an 'AND' Operator 

Use the 'AND' operator to target the fewest set of possible conditions for popup loading.

The 'AND' operator links two or more conditions together to require that each condition be true to load a popup.  Stated another way, if any condition linked by an 'AND' operator is false, the popup will not load.  An 'AND' condition can be added in Popup Settings > Targeting by simply clicking on the term '+ AND'.

'AND' operators are typically used with:

  • a combination of standard and advanced targeting conditions
  • a combination of negative and positive conditions

Sometimes popups that have multiple conditions linked with an 'AND' operator won't load. This can happen when combining different content types, such as:

  • a page and a post
  • a page and post category
  • a page and an image (attachment)

Consider the logic behind the first example in the above list; a page and a post must both be true. Expressed in a statement: 

If the 'Home Page' and a post with the title 'Our Services' are viewed in the browser at the same time, then load a popup named 'Newsletter Signup'. 

That condition is can never happen. Meaning, you can't view the 'Home Page' and any other page (whether page or post) at the same time. Since that condition never happens, any popup that has this condition will never load. 

If a popup does not load when targeting multiple conditions, check how you've set up the conditions operator. Chances are that by changing from an 'AND' to an 'OR' operator, your popup is more likely to load.

[ Back to top ]


Set a Negative (Opposite) Condition

By default, Popup Maker assigns all targeting conditions as positive statements. If a user targets the condition 'Page: Selected' -> 'Home', the popup will load on 'Home'. 

Sometimes users need to exclude or return the opposite of a stated value. To declare a negative (NOT) condition, click the (!) button located to the left of the targeting selector. When a negative condition is activated, the grey button background turns red and the popup returns the opposite of what is selected.

In the screenshot example above, the page named 'Home' is selected.  The negative condition returns the opposite value. The plugin will load the popup to display on all pages except the 'Home' page.

When using  the Advanced Targeting Conditions (ATC) plugin extension, users sometimes wish to display a popup only to site visitors who are not logged in. The ATC extension provides a condition 'User: Is Logged In'. To target the opposite value (user is not logged in), select the NOT operator to the left of the targeting selector. Now the popup will be loaded only for site visitors not logged into the site. 

[ Back to top ]


Modify a Targeting Condition

Edit a Targeting Selector

Change a condition within a selector by choosing from the available drop-down menu options.

Delete a Targeting Selector

To remove a targeting condition, click the (X) icon to the right of the box.

[ Back to top ]


Disable a Popup on Mobile and/or Tablet Devices

By default, the base (free) version of Popup Maker will display a popup on desktop, tablet, and mobile device screens.   Popups can be disabled on all mobile and/or tablet devices by selecting the checkboxes located beneath the targeting option selector.

Note:   To display a popup  only on a mobile or tablet device ( and prevent it's display on a desktop screen ) requires the installation of  the Advanced Targeting Conditions plugin extension to Popup Maker

[ Back to top ]


Add a Custom Targeting Condition

Popup Maker provides a filter 'pum_registered_conditions' to add a custom targeting condition to a popup. The filter is located at '/popup-maker/classes/Conditions.php' in the function 'register_conditions()' on line 434.  

Refer to the related article link below in our developer documentation for examples of how to add custom conditions to the plugin.

Related article: Add a Custom Popup Condition

[ Back to top ]

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.