contact.hs_object_id is sometimes null

We have the following flow:

  1. Hubspot-hosted registration page with Hubspot form
  2. User fills out Hubspot form
  3. User is redirected to a Hubspot-hosted confirmation page, which contains a Google form
  4. Hubspot autofills some form fields in the Google form, including the hs_object_id

Sometimes the completed Google form data shows the hs_object_id as null. I am almost certain this is a Hubspot issue, as we have just recently moved to Google forms from Jotform, and we had the same issue with Jotform too.

My suspicion is that the object_id hasn’t actually been assigned in time for when the form loads. Could this be the case, if so, what is the recommended solution? It seems to only be this property which has a null value, we haven’t seen this with any of the other handful of properties which we also pass into the form.

If it matters, the Google form is in an embedded iframe and the parameters are passed in via the iframe’s src property.

If anyone sends a test submission, please let me know as this is all in production at the moment. Also please make it obvious that the submission is a test!

Thank you in advance!

Hi @Bragg

I have a hunch that you are correct in terms of the property not having an assigned value, yet. I believe @stefen recently shared some advice about this…not recalling which post it was, though

Not an overly helpful response Dennis but I believe you are talking about this post by @stefen

@stefen, in that post you suggest adding a 2 second delay - how would you approcah that? With Javascript?

Thanks in advance

I am known for my not overly helpful responses :upside_down_face:

In an effort to up my game, may I draw your attention to this post?

I think 5seconds is a little dramatic, but test and see.

Apologies for the delay in jumping in here, but if you want to add 2 second delay this is a pretty simple way to do that. Add this to your thank you page and for 2 seconds after the redirect it will display a loading spinner before it refreshes again:

{% if request.query is string_containing "submissionGuid" %}
{# give hubspot time to populate it's database after a user submits new data in order to ungate the page #}
<div class="loading-spinner">
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M456.433 371.72l-27.79-16.045c-7.192-4.152-10.052-13.136-6.487-20.636 25.82-54.328 23.566-118.602-6.768-171.03-30.265-52.529-84.802-86.621-144.76-91.424C262.35 71.922 256 64.953 256 56.649V24.56c0-9.31 7.916-16.609 17.204-15.96 81.795 5.717 156.412 51.902 197.611 123.408 41.301 71.385 43.99 159.096 8.042 232.792-4.082 8.369-14.361 11.575-22.424 6.92z"/></svg>	
</div>
<script>
	setTimeout(function(){
		window.location = window.location.pathname;
	}, 2000);
</script>
{% endif %}