Hubspot forms and Google SSO

SOLVE
Drishtii_
Participant

Hello community!

 

I am trying to work with my dev team and convert all the web forms and app sign in forms we have into Hubspot forms. For this, I am using Hubspot's Forms API and the web form embed code. 

 

One such form on our website allows users to sign up using their Google email. Is there a way for me to capture that email as well and store it on Hubspot?

 

Any pointers or help documentation here will be appreciated. 

 

- Drishtii

0 Upvotes
1 Accepted solution

Accepted Solutions
thesnappingdog
Solution
Contributor

One such form on our website allows users to sign up using their Google email. Is there a way for me to capture that email as well and store it on Hubspot?

 

as far as google oauth2 goes, a successful signin will return profile information back to your callback endpoint. Not 100% sure but I think you set up the scopes within google console so that you'd get their email, name etc. You would want to capture that on the app endpoint, and probably do some sort of database check:

 

user = askMyDatabase(data.email)

if (user === undefined) { submitDataToForm(data) } 

 

then you could try to use the submit form endpoint: https://legacydocs.hubspot.com/docs/methods/forms/submit_form

 

so effectively you would create a form in HubSpot, but you would never really embed did if that makes sense. 

 

let me know if i understood you wrong

 

no idea how your setup is but I hope the general idea comes across 🙂

 

scopes:

https://developers.google.com/identity/protocols/oauth2/scopes 

endpoint for checking contact existence:

https://legacydocs.hubspot.com/docs/methods/contacts/get_contact_by_email

View solution in original post

3 Replies 3
TiphaineCuisset
Community Manager

Hi @Drishtii_ 

 

Thank you for reaching out! 

 

I want to tag some of our experts on this - @tjoyce @Huble_Connor @thesnappingdog  any thoughts to share with @Drishtii_ on this? 

 

Thank you!

Tiphaine


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


thesnappingdog
Solution
Contributor

One such form on our website allows users to sign up using their Google email. Is there a way for me to capture that email as well and store it on Hubspot?

 

as far as google oauth2 goes, a successful signin will return profile information back to your callback endpoint. Not 100% sure but I think you set up the scopes within google console so that you'd get their email, name etc. You would want to capture that on the app endpoint, and probably do some sort of database check:

 

user = askMyDatabase(data.email)

if (user === undefined) { submitDataToForm(data) } 

 

then you could try to use the submit form endpoint: https://legacydocs.hubspot.com/docs/methods/forms/submit_form

 

so effectively you would create a form in HubSpot, but you would never really embed did if that makes sense. 

 

let me know if i understood you wrong

 

no idea how your setup is but I hope the general idea comes across 🙂

 

scopes:

https://developers.google.com/identity/protocols/oauth2/scopes 

endpoint for checking contact existence:

https://legacydocs.hubspot.com/docs/methods/contacts/get_contact_by_email

View solution in original post

Drishtii_
Participant

Thank you!
Will chat with the dev on our team to see if we can implement this.