Content Personalization based on Cookie

Stacie DaPonte asked on September 19, 2014 18:33

Hi there,

I'm creating a cookie in Javascript that I would like to set as a variant condition for an editable text area webpart. A cookie is being set to determine the user's province in Canada.

If the user has selected British Columbia, show this content. If they select any other province, show them this content.

I have tried using the following variations of my display condition:

{@loc@} == bc
{@loc@} == 'bc'
{% Cookies["loc"] %} == 'bc'
{% Cookies["loc"] %} == bc

I've also tried to set two variants, one if == bc, and one != bc. I'm not sure if this is the correct logic, or if it should validate the first condition and fallback on the default if not. I would prefer this option so I don't have 3 different variations, one of which is never being used.

Thanks in advance for your assistance!

Recent Answers

Stacie DaPonte answered on September 19, 2014 19:12 (last edited on March 24, 2018 12:15)

Figured it out, if this is of interest to anyone: {% ( Cookies["loc"] == "bc") %}

Examples in docs were for Kentico >=8. We're using 7.0.43 on this particular site

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.