Is it possible to retrieve contact information and properties from a form submission?


#1

Hi,

I recently started integrating with Hubspot. The current use case I’m working on is very simple, but I’m having a hard time identifying the endpoints that would provide me with the necessary data.

Use Case

After a signup form is successfully submitted, at some point I’d like to redirect the user to back into my app, where I would actually create and sign in said user.

Even though I’m aware of workflows and webhook calls. I’ve noticed form provide a submission id on success, and I’d prefer to use it (if possible at all) to retrieve the necessary data. There are no submission resources I’ve notice so far. So, I guess it boils down to:

Is the submission id useful in any way to retrieve the data that was just submitted? If so, what endpoints are involved?

Thanks in advance, please let me know if you need any clarifications on my part.


#2

Hi @jhenriquez

There isn’t a way to get the details for a specific form submission using the submission ID. That ID will show up in the data you’d get for the contact using the Contacts API, but you can’t get the contact from the ID.

If you’re having a visitor submit a form, and you immediately need the data, your best bet would be to use a custom form and use the Forms API to send the data to HubSpot.


#3

Thanks @dadams for your quick response. After going through your API documentation I was starting to get that feeling.
Unfortunately, I’m afraid having a custom form, though it would be the simplest to implement wouldn’t work for us. We’d like to track the users all the way until a successful conversion.

Of course, probably I’m not fully understanding what you mean by a custom form, being still quite unfamiliar with Hubspot. But just to make sure we’re on the page, I believe you mean I go the other way around. Have the users signup on our site and then post that information to Hubspot through a form submission to create the contact, is this correct?

But I think I’m onto something here. When you said that ID would show up, would that ID (submission ID) happen to be the conversation-id within “form-submissions” from the Contacts API? They are very similar :slight_smile:

If that is the case, probably the recent contacts API could work perfectly for me. Would this make sense?

Thanks in advance,


#4

The conversion-id you’d get in the form-submission data in the contact record is the submission ID you’d get after the form submission, and any properties that were updated in the form submission would show that ID as the source-id in the property version history.

Can you tell me more about what tracking you’re worried about? If you’re looking for page views and other analytics tracking, you can still tie analytics data collected by the HubSpot tracking code by including the hutk value mentioned on the documentation page.


#5

Again, thanks for your quick reply. We really appreciate it. Well, the essence is that our marketing campaigns bring users into our Hubspot landing pages, from where users will hopefully reach our signup page. Currently signup is part of our main app. Being a second application, we have another set of Google Analytics for them so we’re loosing the chain of analytic information that would tell us what visits successfully turn into conversions.

Trying to address this is where we decided to bring the signup form into the Hubspot ecosystem and have it redirect to a success landing page, servings us an analytics conversion marker.

Now, the HubSpot tracking cookie seems very interesting :thinking:. Will all leads redirected into our from Hubspot have this cookie on? That being the case, maybe I can actually have users signup on our end and then post an API form submission associating the lead.


#6

The hubspotutk cookie is set by the HubSpot tracking code, which is automatically included on any pages built with HubSpot, and should be added to any pages that aren’t.

The cookie itself is set to your root domain, so as long as the HubSpot pages and your external pages have the same root domain the cookie would be available on both sites (i.e. if the HubSpot pages are on blog.domain.com, and your main site is on www.domain.com, you’ll have the same value for the cookie on both sites).


#7

I’m trying to accomplish similar, I want to use the HUTK to tie together GA and Hubspot, and then passover contact property data into Google Analytics back from Hubspot, so after someone fills out the form the next day that data can be passed to google analytics and then we can say ok this contact selected “I am interested in” in the form, get a count of that, as well as other profile questions we ask, as their role and the product they end up signing up for, or if they have cancelled, and pass that back into google analytics to create custom audiences and segments on. What is the best way to accomplish that?


#8

Hi,

I noticed that this post is a couple of months old, but if it helps . . .

On the hsvalidatedsubmit event you can grab the form input and then send the user to your app.

See this blog post for information on hsvalidatesubmit.

If sending the user to your app requires a URL query string (ie: foo.com/bar?MyLogin=John), you can “redirect” via window.location.replace( “foo.com/bar?MyLogin=” + name );

Good luck!


#9

Thanks @JFish !

This is actually very interesting information. The last two pieces of code are very close to what I want to do. Just one question tough, do you know if I could prevent the form from submitting anyways when handling the hsvalidatesubmit ?