APIs & Integrations

samerjk
Participant

How to pass VID (Contact ID) in Emails URLs as a parameter

SOLVE

Today, we can use the personalization features in the email body such as first name, email address, contact id...etc. 

 

However, if we want to pass the contact id (VID) as a parameter in the URL (CTA url), it is not working.

 

Why do we need to pass vid in the url? 

The contact id parameter can be used to fetch the contact info when a user opens the email and click on the CTA (URL). 

 

The final url can be appended with the contact vid in which the website or the landing page can query the HubSpot API and query the contact info by providing VID in order to provide a personalized experience. 

 

Example: when creating the email, the url can be

https://www.mydomain.com?memberid={{ContactID}}

 

When a user click on the CTA, the final URL will be  

https://www.mydomain.com?memberid=112233

 

Summary:

HubSpot does not support passing the VID in email CTA URLs. What is the alternative? 

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

How to pass VID (Contact ID) in Emails URLs as a parameter

SOLVE

Hey @samerjk,

 

Edited:

Apologise for my previous response. 

 

Adding contact vid on a <a href url is definitely possible. 

 

On my end, I have tried the following:

<a href="www.google.com?memberId={{ contact.hs_object_id }}">test link</a>

and it work just fine. Could you give it a try and see if it works?

 

Something to note, while we do not support Hubl or personalization in CTA,  you can add it on a anchor tag or a custom module to style it up. 

 

Hope this helps and do let me know if you've any further questions on this!

View solution in original post

7 Replies 7
jk-sone
Participant

How to pass VID (Contact ID) in Emails URLs as a parameter

SOLVE

We were hoping we could inject the VID into a URL in a pre-composed follow-up email after filling out a form, which would otherwise be used to register new customers (the primary use of the form) -- ideally, we would be able to inject the VID as URL redirect after registering, as well. As far as I can see, the follow up email can only be composed in a rich text editor without the ability to write HTML in source code, as suggested by the creation of the <a href="...  in HubL above, nor as a "Redirect to another page" option. Are there other options for building a URL that would read something like https://blah.blah.blah/blah?utm_source=events&VID=12704274 following the submission of a form someone could suggest? Thanks for your help.

0 Upvotes
cedaly
Contributor

How to pass VID (Contact ID) in Emails URLs as a parameter

SOLVE

So the link url in a button on an email cannot be updated to accept this, but we could format a block that looks like a button and it should work - correct?

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

How to pass VID (Contact ID) in Emails URLs as a parameter

SOLVE

@cedaly , yep!

0 Upvotes
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

How to pass VID (Contact ID) in Emails URLs as a parameter

SOLVE

Hey @samerjk,

 

Edited:

Apologise for my previous response. 

 

Adding contact vid on a <a href url is definitely possible. 

 

On my end, I have tried the following:

<a href="www.google.com?memberId={{ contact.hs_object_id }}">test link</a>

and it work just fine. Could you give it a try and see if it works?

 

Something to note, while we do not support Hubl or personalization in CTA,  you can add it on a anchor tag or a custom module to style it up. 

 

Hope this helps and do let me know if you've any further questions on this!

Lily_Chen
Participant

How to pass VID (Contact ID) in Emails URLs as a parameter

SOLVE

Hi @WendyGoh 
Just wondering is it possible to use {{deal.hs_object_id}} in the CTA url as well? 
so something like: 

?dealID={{deal.hs_object_id}}&contactId={{contact.hs_object_id}}
Thank you

0 Upvotes
SDuran2
Member

How to pass VID (Contact ID) in Emails URLs as a parameter

SOLVE

Hi Wendy, 

 

Is this approach still valid? I have tried to add it to my CTA but I keep getting an error.

 

Would like to pass the contactId in the URL, so I would assume {{contact.vid}} would work, correct? 

 

Looking forward to your reply,

 

 

0 Upvotes
samerjk
Participant

How to pass VID (Contact ID) in Emails URLs as a parameter

SOLVE

Thanks @WendyGoh 

 

I tried this and it's working fine!!

 

Thought many HubSpot support agents and community members said it's not supported.