Attributing form submission to a cookie, later to an email?

forms

#1

Hey guys.

I’m building a proof-of-concept with the HubSpot API for forms and I’m curious about the following case.

Preconditions
A brand-new visitor with no info about him in HS at all.

Steps to reproduce

  1. A visitor navigates a couple of pages with HS tracking code, gets the hubspotutk cookie.
  2. A visitor interacts with our custom code that submits a form with no email and the above-mentioned hubspotutk cookie context.
  3. In a day or two a person submits either a custom or a regular HS form with an email, still with the same hubspotutk cookie.

Question
Will the submission visitor made in step #1 be properly attributed to the email he later mentioned in step #3?

Thanks!

Regards,
Alex


#2

Hi @mad

Form submissions only get attributed to contacts at the time of the submission, so for that specific set of steps, the first form submission in step 2 would not get attributed to the contact after filling out the second form in step 3.

Form submissions without an email can still be attributed to an existing contact, but the hubspotutk cookie would need to be associated with a known contact before the submission without the email.


#3

Got it, thank you for clarifying that.

A consequent question then: is there a way to check whether a cookie id is
already associated with an email or not? I’m thinking of a “smart form for
the poor” :slightly_smiling_face:


#4

You can use the Contacts API to look up a record by the utk:

If you get a record that has "is-contact": true, you could check the properties for the email property. If you get "is-contact": false, then the record is just a placeholder with no real data so there’s no real contact for that utk yet.