How to Implement a Specific Cookie Condition

  • Lesson 2 of 5
  • 03:56 min

In This Lesson You Will Learn

How to hide or show your campaign based on a specific cookie.

How does the specific cookie condition work.

How to find the cookies used on your website.

How to implement the specific cookie condition in our editor.

How to Implement a Specific Cookie Condition

Personalization of campaigns can increase the effectiveness of your campaign performance. It is always a bonus to know who exactly you are targeting with your campaigns.

There are many conditions that we provide for you regarding the ability to show or hide your campaign from your visitors. Today we will take a closer look at the specific cookie condition.

By adding this condition you can show or hide your campaign from your visitors with a specific cookie stored in their browser. So let’s dive into how this works!

Understanding the Specific Cookie Condition

So how does the specific cookie condition work? First, you need to decide whether you want to show or hide your campaign when a visitor has a specific cookie in their browser. Then you need to figure out which exact cookie it is and how you want to use it.

But let’s move the explaining to our editor. You can find the specific cookie in the settings part under targeting a specific audience with targeting rules and choosing conditions.

There are two ways of looking at the cookie:

  1. Cookie present
  2. And cookie matches

Cookie present can determine whether your campaign should show or hide based on a specific name of your cookie. Cookie matches can evaluate both the name of your cookie and its value.

The Use of Cookie Present and Cookie Matches

With the specific cookie condition you can, for example, target logged in visitors with a personalized campaign. Let’s imagine that this cookie is called loggedin. If the cookie is only placed once someone is logged in you can use the “cookie present” and just have it look for the name.

If it is always present but has a different value, you would choose the “cookie matches” option, as you need the condition to evaluate both the name of the cookie and its value.

In this case, let’s assume that the value is either “true” or false” depending on whether the user is logged in or not.

So simply write in the cookie field loggedin=true, save the condition and your campaign will only show to the visitors that are logged in to your website.

An important thing to note here is that the cookies are case sensitive. So make sure you have the capitalization of your letters under control.

Where Are Your Cookies?

Now let’s get a bit nerdy. If you are not exactly sure what your cookies are, you can find your existing cookies in the console. Simply press the F12 key on windows and Comman+Option+I on a Mac, go to the application and select cookies.

Our script cannot read the cookies marked with a checkmark under the HTTP value. Therefore we advise you to check your cookies before implementing this condition. If the cookie you would like to use is marked with the checkmark you have to remove it in order for the condition to work on your campaign.  This is all done in the backend, not the browser, so it may be a good idea to discuss it with one of your developers.


Adding the specific cookie condition allows you to give your visitors relevant content with your campaign depending on whether they interact with something specific on your page, whether they interact with the cart, are logged in to your website and much more.

There are two types of specific cookies that you can choose from. The cookie present and the cookie matches. The choice of which one to use depends on whether you want to evaluate only the name of the cookie or if you need its value as well.

You can set it all up under conditions in the settings part of your campaign creation. I hope you will go on and have some cookies!

Still Got Questions? Get In Touch And Let Us Help
