CMS Development

jmcguire20
Member

Display hubspot contact first name based on a contact id in link - possible if statement?

Hi,

 

I'm trying to do something that I think can be done but I'm not a developer, just a marketer. I would like to create a referral landing page that displays a referrer's name based on a value in a link.

Example for someone named John:

  1. You are a contact in hubspot and your contact id = 12345.
  2. I send you this link to use and refer your friends website.com/refer?CID=12345.
  3. Your friend visits the landing page, and the headline reads "Looks like you were referred by John!"
  4. If no CID is in the link, it would display "a friend" instead.

 

If this possible? Can someone provide the code needed in the landing page?

Also this would ideally be scalable, and would want to avoid typing out all the contact ids for each person since there may be a thousand people with these links.

0 Upvotes
3 Replies 3
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Display hubspot contact first name based on a contact id in link - possible if statement?

Hi @jmcguire20 

 

We're working on exactly this challenge for a client (we're a HubSpot Partner Agency)

 

Are you using HubSpot for your Landing Page? Or another website e.g. WordPress?

 

I've got a two week deadline so we should have something soon.

 

Feel free to send me a private message if you'd like to jump on Zoom to discuss your project.

 

Cheers

Mike

 

p.s. Thank you for the mention @dennisedson 

 

 

 

piersg
Key Advisor

Display hubspot contact first name based on a contact id in link - possible if statement?

Hi there,

 

You could create a custom contact property for referrer id and then grab that ID from the URL (as you mentioned: ?CID=xxxx) with {{request.query}}, e.g. {% set id = request.query %}, then use the id to look up that contact using the Contacts API

 

Then you'd need an if statement in your title like "Looks like you were referred by {% if id %}{{contact.firstname}}{% else %}a friend{% endif %}!"

 

dennisedson
HubSpot Product Team
HubSpot Product Team

Display hubspot contact first name based on a contact id in link - possible if statement?

@jmcguire20 ,

This is really cool.  I believe it is possible, but we would need to flesh out a lot more details on the steps.

Immediately, I am thinking

What is the process of becoming a contact who gets to have a referral id? 

  Are you imagining a form being filled out and a workflow that would let that user know their unique referral id?  

What is the action item after the referral is used?  

If you could also add your HubSpot tier here so we can consider properly within the restraints of what you can do, that would be great!

The answer to this can go in about 1000 directions and is not necessarily a 100% coding issue.  I am very interested in the discussion on this topic!

 

@Anton , @Kevin-C , @piersg , @lynton@Mike_Eastwood , @Bryantworks 

a: apologies for my excitement

b: do you all have thoughts on this?  

c: thank you 🙂