Hide & Show WordPress Optin Campaigns Based on Browser Cookies

MailOptin allows you to create optin campaigns (call-to-actions, lead capture forms, banners, popups, etc.) in WordPress that are shown or hidden to your website visitors and users based on the cookies in their browser.

In this article, you’ll learn how to use MailOptin’s Display Rules to hide or show an optin campaign based on cookies.

Cookies are small pieces of information websites store on your computer. Cookies can only contain bits of text and nothing else. For example, the text can be a user or session ID.

For example, a website could have a “Hide link” feature that hides a specific element on the page. The page can save this setting on your computer browser as a cookie. Then, when you load the page in the future, the page can examine the cookie and automatically hide the element.

All cookies have a name and a valuename=value. For example, a cookie could be: location=us

Cookies can be set by your web developer, as it depends on your site’s structure, coding language, and goals.

How to Target Users Based on Browser Cookies

In your WordPress dashboard, go to MailOptin >> Optin Campaigns. Create a new optin campaign or edit an existing one to open up the form builder.

In the form builder, open Display Rules >> Cookie Targeting

The first setting is to activate the rule. Use the “Display Action” setting to determine whether to show or hide the optin based on the cookie setting.

Next, enter the Cookie name to target. If you want to target a cookie with a specific value, enter it in the “Cookie Value” setting.

Example Use Case

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. Then, when customers return 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. So if a user just purchased Product A, you can immediately show them an upsell or a special promotion for Product B.

Another use case would be for those using an advanced email marketing solution like Mailchimp, Infusionsoft, ActiveCampaign, Ontraport, etc., to run a drip campaign. These solutions add subscriber-specific cookies to your users’ browsers. You can use these to show personalized popups based on the user’s stage inside your marketing funnel.