APIs & Integrations

Eleven11
Colaborador líder

Dynamic Form/Content Section on WordPress

I'm looking to make a section on our blog posts (our site runs WordPress) dynamic in the following way. 

1. Visitor first sees a section with a form to subscribe. 

2. After filling out the form, on the next visit, they will see the form section replaced with different text and a button or a form. 

The obvious goal is to stop showing the same irrelevant form every future time someone reads our blog after subscribing. 

 

I know this can be done in HubSpot's CMS pretty easily with smart sections and there isn't an out-of-the-box HS provides. However, can't this be done through the API? What would this look like? Can anyone point me in the right direction here? 

0 Me gusta
2 Respuestas 2
Willson
HubSpot Employee
HubSpot Employee

Dynamic Form/Content Section on WordPress

Hi @Eleven11 

 

My understanding is that this would not be a feature our APIs directly support. Instead, this would rely heavily on code on your site (custom) that determines the behaviour of the content displayed.

 

The only APIs that could be used would be to query if a contact can be identified by their Contact Token that is placed when they initially submit the form. This endpoint can be found here.

 

The above endpoint could be used with some code checking for a record against the hutk stored in the session, if a record can be found, display content B else, display content A. Regardless of the configuration, there is no endpoint which directly supports this HubSpot CMS functionality externally. 

 

Thanks!

Product Manager @ HubSpot
0 Me gusta
Eleven11
Colaborador líder

Dynamic Form/Content Section on WordPress

Can we not use the cookie to return contact properties? I just need to return their lifecycle stage if the contact exists.

Certainly this is possible through the API, but maybe it's not possible with just the HS cookie? 

Documention here shows that properties can be returned through API if I am not mistaken. I'm familiar with code, but not a programmer so forgive me if I'm misunderstanding something. 

I know that using a tool like Zapier propery values for contacts can be returned, so why couldn't I program my website to do the same thing? 

I do need to know more than if the contact just exists in HS. 

 

Thanks!

0 Me gusta