Showing gated and ungated content based on form submission

Occasional Contributor

I have a HubSpot form embedded into a WordPress page.


What I'm trying to achieve is gated and ungated content. See these use cases as an explanation:


  • User enters WordPress page for the first time on content that is gated by default (by gated I mean it shows a form).
  • User fills out the form and gets redirected to whatever is specified as the redirect option in HubSpot (the content is now ungated).
  • User closes the window but decided to back onto the WordPress page.
  • Now, since the user has already filled out the form (the cookie for hubspotutk exists), I want the user to be refirected straight to the asset (whatever is specified in the redirect option in HubSpot forms).


How far have I got?


  • I've created an ACF field in WordPress with radio buttons for Gated or ungated content. By default, all content is ungated.
  • I've then set a cookie based on this ACF field value. I.e. if the content is gated, resourceType cookie equals "Gated".
  • That's how far I have got.


The next steps (I think) would be to...

  • Only "ungate" the page if the user has filled out that form. For example, I've completed a form, the hubspotutk cookie value is "23a43a4a6de9c38f7657ebd08d574scf". How does HubSpot know which form this value is assigned to?


Other concerns:


  1. If the user has filled out the form already, how to I redirect them straight to the asset? Is there a way to get the "redirect to another page" value in the image below as a variable?


Screen Shot 2019-11-28 at 10.20.11.png

I don't want to use HubSpot Forms API because I don't expect the admin to create the forms via the API. They'll want to create it via the HubSpot forms option.

1 Reply 1
Advisor | Platinum Partner



If u can create one page in HubSpot, u can use the smart content to hide form and show one CTA if this contact is part of the alternative / smart content criterion.


But in WordPress, just with form embed of HubSpot, i believe is not possible. 


Wait for new answers, but I suggest that you create a landing page / page directly in HubSpot, using the smart content feature.


Please, if this content is what you are looking for, mark it as a solution.

Best regards!