Forms on Safari not creating Contact in CRM

SOLVE
New Member

Hi,

 

We have several forms up and running. Today we noticed that forms submitted on Safari (iOS or Mac) do not create the contact in our CRM. They redirect the user to the next page just fine, but the contact is never created.

 

We have had lots of contacts and tests come from Safari in the past so this seems to be a recent issue. 

 

We have tested on other browsers and it works just fine. 

 

An example of a form which is not creating a contact is here: https://form.gethousesurvey.ie/buyer-form

 

Has anyone come across this issue with Safari before? 

 

Thanks! 

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
HubSpot Product Team
HubSpot Product Team

Hey @EmmaT ! Tom here from the HubSpot forms team. 

 

I just took a look at the form you have linked on your page here: https://form.gethousesurvey.ie/buyer-form

 

It looks like you are using a customised version of our forms embed code which uses our "onFormSubmit" function as outlined here:

https://developers.hubspot.com/docs/methods/forms/advanced_form_options

 

When this runs the custom script within your page is using the JavaScript "window.location" object which changes the url of the page. This runs when the "onFormSubmit" function runs. From the doc linked:

"Callback that executes after form is validated, just before the data is actually sent. "

 

This means that it's possible for the custom code in here to run and change the URL of the page before our form actually has the opportunity to submit the data to us. It sounds like safari is likely constantly running this prior to the submission happening. 

 

You may need to consult your developer who customised this embed code to review this and ensure that no changes to this will affect any integrations or your page in unexpected ways. However, I'd recomend changing the "onFormSubmit" function to "onFormSubmitted" as outlined in this doc:

https://developers.hubspot.com/docs/methods/forms/advanced_form_options

 

"onFormSubmitted" is similar to the callback you have however the important disctinction is that this runs *after* the form has submit data to HubSpot and not before. This would ensure all of your submissions are entered to HubSpot without issue before your custom code is run. 

 

I hope this helps! Smiley Happy 

1 Reply 1
Highlighted
HubSpot Product Team
HubSpot Product Team

Hey @EmmaT ! Tom here from the HubSpot forms team. 

 

I just took a look at the form you have linked on your page here: https://form.gethousesurvey.ie/buyer-form

 

It looks like you are using a customised version of our forms embed code which uses our "onFormSubmit" function as outlined here:

https://developers.hubspot.com/docs/methods/forms/advanced_form_options

 

When this runs the custom script within your page is using the JavaScript "window.location" object which changes the url of the page. This runs when the "onFormSubmit" function runs. From the doc linked:

"Callback that executes after form is validated, just before the data is actually sent. "

 

This means that it's possible for the custom code in here to run and change the URL of the page before our form actually has the opportunity to submit the data to us. It sounds like safari is likely constantly running this prior to the submission happening. 

 

You may need to consult your developer who customised this embed code to review this and ensure that no changes to this will affect any integrations or your page in unexpected ways. However, I'd recomend changing the "onFormSubmit" function to "onFormSubmitted" as outlined in this doc:

https://developers.hubspot.com/docs/methods/forms/advanced_form_options

 

"onFormSubmitted" is similar to the callback you have however the important disctinction is that this runs *after* the form has submit data to HubSpot and not before. This would ensure all of your submissions are entered to HubSpot without issue before your custom code is run. 

 

I hope this helps! Smiley Happy