APIs & Integrations

patPMG
Member | Diamond Partner
Member | Diamond Partner

Dynamic keyword insertion on a landing page

I have been told I cannot use dynamic keyword insertion on a Hubspot landing page because Hubspot doesn’t support php.

Does anyone know a workaround? Alternately, is there a third party landing page option that works with Hubspot that would make DKI possible?

I am trying to do what has been done many times on html landing pages:
– Someone searches for something on Google and sees an ad related to their keyword
– The destination url for the ad has a token in the string that carries the keyword (ex: affordableplumbing.co/?{CityName}=WhateverCityIWantToAddHere). Note: this url actually works. You can insert whatever word you want.
– Some code on the landing page pulls that token out and inserts it where you want it.

5 Replies 5
boulter
HubSpot Product Team
HubSpot Product Team

Dynamic keyword insertion on a landing page

Hi there. This is possible. If you add a custom HTML module to your template or page, you can use HubL to extract query string parameters and insert them into your page. For example:

{% if request.query_dict['country'] %}
   you passed a country parameter with the value '{{ request.query_dict['country'] }}'
{% endif %}

You can view all the HTTP variables available to you in the HubL documentation.

0 Upvotes
Jeromecollomb1
Member

Dynamic keyword insertion on a landing page

Hi.
Does that work with any contact property?

Thanks!

0 Upvotes
boulter
HubSpot Product Team
HubSpot Product Team

Dynamic keyword insertion on a landing page

This is not specific to contacts. It’s just adding whatever is passed on the query string. Note that this can be dangerous if don’t escape the input since someone could change the URL to add in javascript and steal users’ cookies. You can use the ‘escape’ filter to fix this.

0 Upvotes
Jeromecollomb1
Member

Dynamic keyword insertion on a landing page

Thank you Jeff :grinning:
It now works perfectly when I write the parameter directly in the url:

http://get.myfeelback.com/getonboard?contact.prenom_csm=Camille&contact.firstname=Xavier&owner.firstname=Dino

but not when sending an email to my contacts with a CTA containing the following url (:

http://get.myfeelback.com/getonboard?contact.prenom_csm={{contact.prenom_csm}}&contact.firstname={{contact.firstname}}&owner.firstname={{owner.firstname}}

I can’t see why. Any help from the community greatly appreciated. Thank you!

0 Upvotes
patPMG
Member | Diamond Partner
Member | Diamond Partner

Dynamic keyword insertion on a landing page

Thank you so much Jeff for taking the time to provide this info. Admittedly, I don’t fully understand your answer (I’m not a web designer/developer) so I am going to pull in my agency’s web designer on this topic. If he has a followup question, I will add to this string.

0 Upvotes