# Conditionals with personalization token

**URL:** <https://community.hubspot.com/t/conditionals-with-personalization-token/71120>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [December 13, 2022, 3:49pm UTC](https://community.hubspot.com/t/conditionals-with-personalization-token/71120 "2022-12-13T15:49:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacjanowski](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jacjanowski/32/3192_2.png) [@jacjanowski](https://community.hubspot.com/u/jacjanowski)\
**Post date:** [December 13, 2022, 3:49pm UTC](https://community.hubspot.com/t/conditionals-with-personalization-token/71120/1 "2022-12-13T15:49:01Z")

</div>

I have a Hubspot landing page and what I want to do is personalize the landing page so that when a Hubspot contact under our Contact List visits the page, I want it to say ‘[First Name], Welcome’. If they aren’t a contact, then it would just say ‘Welcome’. This is what I have so far:

```lia-code-sample
 {% if contact.property is true %}
 <h1>{{ contact.firstname }}, Welcome!</h1>
 {% else %}
 <h1>Welcome</h1>
 {% endif %}

```

Am I doing this right? Because I am a contact and when I visit the page, it’s not working… Ideas??

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 14, 2022, 5:44pm UTC](https://community.hubspot.com/t/conditionals-with-personalization-token/71120/2 "2022-12-14T17:44:29Z")

</div>

Hi, @jacjanowski 👋 Thanks for reaching out. Here’s a solution from one of the community champs to help get you started — [If statement to check if personalization token is empty](https://community.hubspot.com/t5/CMS-Development/If-statement-to-check-if-personalization-token-is-empty/m-p/520864/highlight/true#M25937). Hey, @BarryGrennan @jpsanchez, do you have any tips for @jacjanowski?

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![jpsanchez](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jpsanchez/32/106486_2.png) [@jpsanchez](https://community.hubspot.com/u/jpsanchez)\
**Post date:** [December 14, 2022, 5:56pm UTC](https://community.hubspot.com/t/conditionals-with-personalization-token/71120/3 "2022-12-14T17:56:58Z")

</div>

Hi ,

not sure why you need to do it just hard-code , you can do this from CMS with SMART CONTENT add token and IMPORTANT “DEFAULT VALUE” = NO VALUE ( in this case or what ever value you want if the contact is not in your list )

Just let me know if is fine for you

Best

JP

😉

---

<div class="post-metadata">

**Author:** ![jacjanowski](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jacjanowski/32/3192_2.png) [@jacjanowski](https://community.hubspot.com/u/jacjanowski)\
**Post date:** [December 15, 2022, 1:49pm UTC](https://community.hubspot.com/t/conditionals-with-personalization-token/71120/4 "2022-12-15T13:49:15Z")

</div>

Thank you! I turned off the global default personalization name and now it seems to work! One final follow up question: The way that {{contact.firstname}} works (I’m assuming) is that it goes into the Contact list and seacherse for your name and pull the ‘first name’ attribute. However, I am a contact and when I view the page, my name doesn’t show up, but someone elses does. Does it look at IP address or something to dictate who is who?

---

<div class="post-metadata">

**Author:** ![jpsanchez](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jpsanchez/32/106486_2.png) [@jpsanchez](https://community.hubspot.com/u/jpsanchez)\
**Post date:** [December 15, 2022, 2:57pm UTC](https://community.hubspot.com/t/conditionals-with-personalization-token/71120/5 "2022-12-15T14:57:13Z")

</div>

How it works. ( per your setup)

Use this list of contacts

If you Identify a contact. Them in this page, show XX propertie.

If the contact is not identify show default value.

----------

How it works? Using HubSpot Cookies, … that means testing can be a bit nightmare if don´t know. ! . Clear cookies, open new private browser session. For all this reason i recomend to use the PREVIEW VIEW in hubspot and choose PERSONALIZATION for example.

Hope it works!

Best

JP

😉

PS ( if you like the answer please mark it! )

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 15, 2022, 5:37pm UTC](https://community.hubspot.com/t/conditionals-with-personalization-token/71120/6 "2022-12-15T17:37:03Z")

</div>

Thank you, @jpsanchez 🙌 You rock! — Jaycee
