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:
{% 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??
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. Hey, @BarryGrennan @jpsanchez, do you have any tips for @jacjanowski?
Best,
Jaycee
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

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?
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! )
Thank you, @jpsanchez
You rock! — Jaycee