Popup with cookie on external site

Highlighted
Top Contributor | Gold Partner

My client, unfortunately, does not like the look of the Hubspot popup form. They have asked me to program a custom one that will 

1 - check to see if the visitor has already completed a form (via cookie)

2 - If no, then popup a modal with an embedded hubspot form

3- after the fill out the form, auto close the form via javascript.

 

Is this possible and if so, can someone point me to to some help docs or links? The popup will show on a non hubspot website (wordpress)

Reply
0 Upvotes
2 Replies 2
Highlighted
Esteemed Contributor | Diamond Partner

Hi @mrspabs ,

 

To show the pop-up form only to people who have not yet completed a form, you can use the built-in targeting. Based on whether someone is in a list that you have chosen, the pop-up form is displayed or not. For more information about targeting, please take a look here

 

Regarding autoclose after the form has been filled in, this is not possible as standard in HubSpot. Hopefully someone from the Community will respond who has more experience with this topic.

 

Please let me know if I can help you any further with the first part of your question! 

 

Kind regards, 

Kim

 

 

Highlighted
Advisor | Elite Partner

If you are using a regular Hubspot form intsead of a Hubpot Pop Up form I imagine you would need to use the Hubspot contacts API to grab the contact's information by their user token and check if they are in the partilcuar list you want to filter by.

https://developers.hubspot.com/docs/methods/contacts/get_contact_by_utk

For auto-closing the form on successful submission you could use the form embed code's onFormSubmit function to do this.

hbspt.forms.create({
    portalId: "{{ PORTAL.ID }}",
    formId: "{{ FORM.ID }}",
    onFormSubmit: function($form) {
      $('#custom-form-wrapper').hide();
    } 
});


Alyssa Wilie
Web Developer
LyntonWeb

Alyssa Wilie

Web Developer at LyntonWeb

If this answer solved your question, please mark it as the solution!

Reply
0 Upvotes