Auto-populate a contact property in landing page from url parameter


#1

Hi,

On a hubspot landing page, I'm displaying a company logo based on a contact property (using the clearbit logo api).

<img src="//logo.clearbit.com/{{contact.company_domain}}" width="128" height="128">

It works perfectly when the contact exists and has this property filled.

Problem: I want to be able to display any logo, even if the contact doesn't exist yet. I was thinking forcing it by adding url parameter into my landing page URL like below (just like we do when auto-populating forms):

http://mypage.com/anything?{{contact.company_domain}}=nike.com

or maybe this?

http://mypage.com/anything?company_domain=nike.com

but it doesn't work. Any advices or quick hacks to achieve this?

Thanks!


Form value auto populated via query string
#2

Hi Jerome,

Since your problem is when a contact does not exist, why don't you try this?

{{request.query_dict.company_domain}}

We should to fetch values from the URL into our tracking codes.

If I've understood you well, this should do it.


#3

Hey @Javier_Revilla,

Thanks for answering. I've tried this in my landing page url:

http://get.myfeelback.com/survey-preview-query?company_domain=nike.com

And I've tried each of these lines in my template, with no luck:

<img src="//logo.clearbit.com/{{request.query}}">
<img src="//logo.clearbit.com/{{request.query_dict}}">
<img src="//logo.clearbit.com/{{request.query_dict.company_domain}}">
<img src="//logo.clearbit.com/{{request.query_dict.get('company_domain')}}">

I've found some interesting info here, if you're interested. I'm stuck, any help appreciated!


#4

Hi,

I can't find why it isn't working for you. For example, we are just using this:

{{request.query_dict.lead_id}}

to fetch the paramter lead_id from the url and it works perfectly, it sends it into a rich text module.Sorry I can't be of more help:/


#5

Hi @Jeromecollomb,

Can you send me a link to the page in question so I can take a closer look?


#6

Sure, here is the link to the landing page
http://get.myfeelback.com/survey-preview-query

Thanks @Derek_Gervais


#7

Hi @Jeromecollomb,

I jumped in and checked out that page, and it looks like it's still depending on a personalization token (i.e {{contact.company_domain}}) for the logo URL. I don't want to edit that page on your behalf; could you try replacing the personalization token with a HubL query selection (mentioned above)?

You can also try using a HubL if statement to default to the contact personalization token in the event that the contact already exists:


Form value auto populated via query string
#8

Hi @Derek_Gervais thanks for taking the time to check the page.

I replaced the personalization token with the same query selection I placed a few days ago and it worked like a charm. I don't get it, I'm guessing it was a cache issue!

Thanks a bunch Derek, you made my day!

PS: For those who are interested, the code is the following:

<img src="//logo.clearbit.com/{{request.query_dict.company_domain}}">

Form value auto populated via query string