Skip to main content

HubSpot integration

Send quiz takers to HubSpot as contacts, with their answers, recommended products and a link to their results, for your segments and workflows.

Written by Traian

With the HubSpot integration, quiz takers who leave their email are added to HubSpot as contacts. Their answers go into contact properties, along with the products the quiz recommended them and a link to their results, so you can build segments and workflows on what each customer told you.

Step 1: Create a service key in HubSpot

A service key lets Lantern add contacts to your HubSpot account. To create one, you need to be a super admin in HubSpot or have the Developer tools access permission.

1.1 Log in to HubSpot, open Development in the main menu, then Keys, then Service keys, and click Create service key.

1.2 Give it a name you'll recognize, like Lantern. Click Add new scope and add only these four scopes:

  • crm.objects.contacts.read

  • crm.objects.contacts.write

  • crm.schemas.contacts.read

  • crm.schemas.contacts.write

Keep it to these four. HubSpot can refuse to create a key that asks for every scope, and Lantern doesn't need the others.

1.3 Click Create, confirm, and copy the key. It starts with pat-, for example pat-na1- or pat-eu1- depending on where your HubSpot account is hosted.

Already have a private app? HubSpot stopped letting accounts create new private apps in October 2026, but existing ones keep working. If you have one with the four scopes above, you can paste its access token instead of a service key.

Step 2: Connect HubSpot in Lantern

2.1 In Lantern, open Integrations, find HubSpot under Marketing and click Connect.

Image showing the HubSpot card on Lantern's Integrations page with the Connect button.

2.2 Paste your key into Service Key.

Image showing the HubSpot window in Lantern with the Service Key field filled in.

2.3 Click Connect. Lantern checks the key with HubSpot, and the card shows Connected.

Image showing the HubSpot card on Lantern's Integrations page with the Connected badge and the Edit button.

That's all the setup there is. Once connected, every active quiz in your store sends quiz takers to HubSpot, with no settings to change per quiz.

What HubSpot receives

When a customer completes a quiz and leaves their email, either on the Optin Page or in the Email sign-up on the Results page, Lantern creates a contact in HubSpot, or updates the contact with that email if it's already there, with:

  • Name and phone: HubSpot's own First name, Last name and Phone number properties, when the Optin Page asks for them.

  • Answers: one contact property for each question with a Question Property ID (see the next section).

  • Lantern results URL (lantern_results_url): a link to their results page, so your emails can send them back to their recommendations.

  • Lantern quiz (lantern_quiz): the URL handle of the quiz they took, for example skin-care-finder.

  • Lantern recommended products (lantern_recommended_products): the names of the products on their results page, separated by commas.

  • Lantern completed at (lantern_completed_at): the date and time they completed the quiz.

Lantern creates the properties it needs the first time a customer is sent, in a property group called Lantern. If the customer is already in HubSpot, for example because they took the quiz before, Lantern updates these properties. Their other properties stay as they are.

How answers become contact properties

Every question can have a Question Property ID, a short name for its answer that you set in the question's right-hand panel in the quiz editor. Lantern saves each answer in a HubSpot contact property for it. You can read more about Property IDs in How to use customer answers in Lantern quizzes.

HubSpot property names use small letters, numbers and underscores, so Lantern turns the Property ID into that form: skin_type stays skin_type, and Skin-Type becomes skin_type. If your account already has a contact property with that internal name, or with the Property ID as its label, Lantern uses it. If it doesn't, Lantern creates a single-line text property labeled with the Property ID.

Choice questions don't have a Property ID by default, so give one to every question you want in HubSpot. If you point an answer at one of your own properties that only accepts certain values, like a dropdown, the answer has to be one of its options. When HubSpot refuses a value, Lantern saves the contact without that answer and keeps the rest.

Segments and workflows

HubSpot has no tags, so the Lantern properties do that job:

  • Segments: filter contacts on Lantern quiz to get everyone who took a quiz, or on an answer property, for example everyone whose skin type is oily.

  • Workflows: start a contact-based workflow when Lantern completed at is known, and turn on re-enrollment when the property changes, so a customer who takes the quiz again goes through it again. Workflows are part of HubSpot's paid plans.

  • The Lantern properties appear in HubSpot after the first completion, so take the quiz once yourself with your own email first.

Inside a workflow, add branches on the answer properties to send each customer the email that fits their answers.

Marketing consent

Lantern only sends customers who can be emailed:

  • A contact is sent when the customer left an email and Subscribe to email marketing is on for the quiz.

  • Nothing is sent when the customer declined marketing. If your Optin Page shows an optional consent checkbox and the customer leaves it unticked, they aren't sent.

  • Nothing is sent for a customer who left only a phone number, because HubSpot finds contacts by email.

The switch is on the Optin Page: open Integration Settings on the right-hand side. It's on by default, and the section appears once HubSpot is connected. Lantern never changes a contact's email subscriptions or marketing contact status: HubSpot applies your account's own settings to new contacts. To set up the Optin Page and its consent checkbox, see Collect customer emails.

Using quiz data in HubSpot

Once quiz takers arrive in HubSpot, you can:

  • See a customer's answers and recommended products on their contact record, in the Lantern property group.

  • Build segments on the answer properties or the quiz, for example everyone who took your skin care quiz.

  • Start a workflow when a customer completes a quiz.

  • Link back to the customer's recommendations in a marketing email with the personalization token Lantern results URL.

Disconnecting and troubleshooting

To disconnect, open Integrations, click Edit on the HubSpot card and click Disconnect. Lantern stops sending customers. Your contacts and properties stay in HubSpot.

If Lantern won't save, the key was copied incompletely or was deleted in HubSpot. If Lantern says the key is missing a scope, open the key in HubSpot and add the scope from step 1.2.

If customers stop arriving in HubSpot, the most likely reason is that the key no longer works, for example because it was deleted or rotated. HubSpot can rotate service keys automatically every few months. Copy the new key, click Edit on the HubSpot card in Lantern, paste it into Service Key and click Update.

Good to know

  • Sensitive answers are not shared. Answers to questions set to Don't share or Don't store are never sent to HubSpot. See How Sensitive Data Controls Work.

  • Test submissions are included. Completing the quiz in Preview with an email adds that person to HubSpot too.

  • Changing a quiz's URL handle changes its Lantern quiz value, so segments and workflows that use the old handle stop getting new customers from that quiz.

  • Zapier still works. If you'd rather build your own automation, the Zapier integration can also send quiz takers to HubSpot.

Did this answer your question?