With Advanced Ads Pro, you can display or hide an ad based on the existence or the value of a cookie. Cookies are small pieces of information saved by different services in the visitor’s browser.
Table of Contents
There are multiple use cases on very advanced setups for this. Take a look at the examples below for some inspiration.
You don’t have to make any changes to display an ad everywhere. Only use this option if you want to limit the visitors to which the ad is visible.
To make use of the cookie Visitor Condition, go to the Visitor Conditions meta box and add the Cookie condition.
There are three settings now.
The name of the cookie.
Choose from the available operators:
- contains/does not contain
- starts with/does not start with
- ends with/does not end with
- matches/does not match
- matches regex/does not match regex
Set the operator to “match/does not match” and leave the value empty to check only the cookie’s existence.
The value of the cookie. Leave this field empty if you only want to check whether the cookie exists or not, but the value does not matter to you.
Examples for the cookie condition
I first used this condition to display a cookie consent message to visitors. You can read all about it in the tutorial How to display an EU Cookie Law compliant Info Message.
Ads based on Optin-Monster status
If you are using the famous opt-in service Optin-Monster, you can use the cookie they set to display an ad if a user has already closed the subscribe form before. Or you can show another form, etc.
The default Optin-Monster cookie reads like
om- + form ID, e.g.,
If the user closed the form, then a cookie with this name is set with the value true.
So, to display an ad or any other content to a visitor who already closed the opt-in form with the id
om-1256, you can use the following settings.
- When you are using the Cookie condition combined with AJAX cache-busting, cookies with a specific path are not working.