This article is an addition to our main article about behavior-based personalization.

What are Cookies? 

A cookie is a small piece of data sent from a website and stored on the user's computer by the web browser. Cookies help your website remember information (e.g. items added to shopping cart, information entered in a form field,...) or record the user's browsing activity (e.g. clicking a button). 


Ideas for cookie-based personalization: 

  • Logged-in users: Existing users need to be retained, not acquired. Change your website messaging accordingly. Inform logged-in users about new and improved features, swap out your salesy content for more in-depth explanations, and change your CTAs to move users further down the funnel.
  • Personalize based on affiliate: You don't use affiliate links, instead you drop cookies to identify who referred a visitor? With cookie-based personalization you can read the cookie-value and personalize your website accordingly. You sell accounting software and you have big affiliate network? Set an "affiliate" cookie and personalize your website by mirroring the affiliate's tone-of-voice and repeat their endorsement. Personalize both, landing page and follow up pages to reassure visitors about the trust the affiliate puts into your business. .  

  You use affiliate cookies? Create personalizations based on cookie value.   


Basic: How to create a cookie-based audience

Generally, you have two options - target based on the existence of a cookie or the value of a cookie.

1. How to personalize based on the existence of a cookie: 

When setting up your target audience, choose: behavior > cookie > is set > nameofyourcookie

Here, we target users for whom the cookie "isLoggedIn" is set. 



2. How to personalize based on the value of a cookie: 

If you want to display a variation based on a specific value of a cookie, you'll have to enter both, the name of the cookie and its value → nameofyourcookie=value

Here, we target users for whom the cookie "customerPlan" has the value "basic"



Advanced: How to set a new cookie

By adding some custom Javascript, you can set up your own cookies. This way you can personalize based on landing page or pages viewed. Here are the two steps you need to take for this:

1. Add a cookie:

Use the advanced editor to add a cookie following this naming structure: Txt.setCookie(name, value, days)

In this example we set the cookie Txt.setCookie('solution', 'startup', 365);).


2. Define the cookie as a targeting condition

Now, use the cookie to define your target audience. Choose: behavior > cookie > is set > nameofyourcookie=value

For the "Startup" audience, we use the cookie as a targeting condition. Now, we can personalize for all visitors who initially arrived on the Startup landing page.


Prerequisite for using cookies: 

For security and performance reasons, your website doesn't send cookies to Unless by default. To create an audience based on a cookie, you need to add an extra code snippet to your Unless script to whitelist the cookie you want to send to us.

Here's the required snippet: 

<script>
window.TxtOptions = {sendCookies: ['cookieNameA', 'cookieNameB']}
</script> 

Replace the value ' 'cookieNameA' with the actual name of your cookie.

Did this answer your question?