OptinMonster makes it easy to hide or show campaigns based on the cookies in your visitor’s browser.
In this article, you’ll learn how to use OptinMonster’s Display Rules to hide or show a campaign based on cookies.
Before You Start
Here are some things to know before you begin:
- Cookie targeting is available with a Pro or higher subscription.
- Cookie targeting can be used with any campaign type.
- This article covers specific settings in the Display Rules. If you’re just getting started we recommend reading our general Display Rule documentation first.
Configure Cookie Rule
When you create a campaign in OptinMonster you can configure it to be shown or hidden based on a visitor’s cookie.
To configure the cookie rule, follow these steps:
- Navigate to the Display Rules view in the campaign builder.
- When adding a new rule, select Cookie Targeting from the Targeting menu.
- Configure the Key and Value operators and fields as you require.
The following match options are available:
- Key only:
- does not exist
- Value only:
- not empty
- Key and Value:
- exactly matches
- does not exactly match
- does not contain
- starts with
- does not start with
- ends with
- does not end with
- is empty
- is anything (if the key or value is irrelevant choose this option)
- matches the pattern
- Key only:
- When you’re finished, click Save.
The cookie detection rule allows you to add real-time onsite retargeting campaigns.
For example, if you have an online store, your eCommerce software adds a cookie to every user who has purchased a product from you. When that customer returns to your website, you can use the cookie detection rule to show them a returning customer discount.
The best part is that cookie detection is happening in real-time. Meaning if a user just purchased Product A, you can immediately show them an upsell or special promotion for Product B.
Another use case would be for those who are using an advanced email marketing solution like Infusionsoft, ActiveCampaign, Pardot etc. to run a drip campaign. These solutions add subscriber-specific cookies to your users browser. You can use these to show personalized popups based on the stage the user is inside your marketing funnel.
If you’re serious about jumpstarting your website business growth, then get started with OptinMonster today!
Our conversion experts will design 1 free campaign for you to get maximum results – absolutely FREE! Click here to get started →
What are cookies?
Cookies are little pieces of data in a web browser that is unique to each site. Each cookie contains only bits of text, nothing else. The text can be a user ID, session ID or any other text.
Cookies are very common, it’s normal to have hundreds or even thousands stored in your browser at any given moment.
For example, cookies help a website determine if you’ve logged into an account and keep you logged in while you continue browsing through the site. Clearing your cookies on that site would immediately log you out of your account.
All cookies have a key and a value:
key=value. For example, a cookie could be:
How do I set a cookie on my site?
This question is best answered by your web developer, as it depends on your site’s structure, coding language, and your goals.
Here are a few articles to help you learn how to do this effectively:
- Cookie Definition and Code Overview
- Get and set the cookies associated with the current document.
- The Cookie HTTP request header contains stored HTTP cookies previously sent by the server with the Set-Cookie header.
- The Set-Cookie HTTP response header is used to send cookies from the server to the user agent.
- How to Write a Cookie.
- Firefox Developer Tools to Inspect Cookies.
How do I hide this campaign if the visitor has already seen one of my campaigns?
To hide or show a campaign based on the visitor seeing another specific campaign can be done using MonsterChains.
If you want to hide all campaigns on your site after the visitor has seen or subscribed to any of your campaigns, then you should configure global cookies.