Skip to content

mattpallatt/MP.OptiForm2HubSpotPush

Repository files navigation

MP.OptiForm2HubSpotPush

Description

This package extends Optimizely Forms to allow for pushing a users' data directly into HubSpot CRM via a HubSpot Form.

Installation & Configuration

There are three steps to getting up and running.

  1. Update startup.cs
  2. Update your appSetting.json
  3. Configure your Optimizely Form

Update startup.cs

Add the following to your startup.cs

services.Configure<HubSpotPushOptions>(_configuration.GetSection("HubSpotPush"));

Update appSettings.json

  1. Log into HubSpot
  2. Use the cog in the top right to enter settings

image

  1. Then go to Private Apps

image

  1. Here you can go to an existing app, or create a new one - either way, you should then navigate to the Auth tab, and take a copy of your apps Access token. Ensure that your app is scoped to use "forms".

image

  1. Add this Access token as a BearerToken to appSettings
 "HubSpotPush": {
   "BearerToken": "pat-xxx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
 }

Optimizely Form Configuration

You need to do two things.

  1. Set your Form ID
  2. Configure your Optimizely Form fields

Set your Form ID

  1. Log into HubSpot
  2. Go to your form
  3. Edit your form
  4. Click Embed, then select the option for Embdedded code
  5. You will see a block of JavaScript with a formId - copy this!
<script charset="utf-8" type="text/javascript" src="//js-xx1.hsforms.net/forms/embed/v2.js"></script>
<script>
  hbspt.forms.create({
    region: "xxx",
    portalId: "xxxxxxxxxx",
    formId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  });
</script>
  1. In your Optimizely Form, goto Settings
  2. Add a WebHook endpoint to your form
  3. This should be set to hs:// and then the formId you copied in step 5.

image

Configure your Form Fields

For each field you want to send to HubSpot, make sure that the fieldname in Hubspot (lastname, email)...

image

...matches the fieldname you have set in Optimizely Forms...

image

The label for your fields can differ, but the Name of the field must be the same

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages