Dynamic Form/Content Section on WordPress

Eleven11
Top Contributor

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 Upvotes
2 Replies 2
Willson
HubSpot Employee

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 Expert | Customer Support
HubSpot
0 Upvotes
Eleven11
Top Contributor

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 Upvotes