PathFactory-Hubspot Integration

There are 2 points of integration between PathFactory and your HubSpot Account:

  1. Identifying Visitors using Form Submissions and Email Tracking

    • PathFactory is able to identify anonymous visitors to your content tracks through standard PathFactory form or custom HubSpot form submissions

    • We can also identify visitors in the PathFactory platform (and therefore associate their engagement data with their contact info) when visitors enter your content tracks from a link within an email

  2. Sending Engagement Data from PathFactory to HubSpot

    • Use Webhooks to send data triggered by specific events, like when a visitor meets an engagement score threshold or views a particular content asset

Note
If you want to export all available PathFactory data to a data warehouse PathFactory offers the ability to create Public API keys.

Identifying Visitors

A lead capture form is useful when you are driving unknown traffic to a PathFactory content track from a website or 3rd party site. When an unidentified visitor arrives at a content track, a lead capture form can be presented to obtain information from that visitor to identify them in both PathFactory and your Marketing Automation Platform (MAP).

There are two types of forms that we recommend when integrating with HubSpot.

  • External form from HTML

  • Standard form (created using the PathFactory form builder)

Ensure your content track visitors are being identified by following these steps:

If you are using a standard PathFactory form:

If you are using a custom HubSpot form:

  1. Build your form in HubSpot

  2. Add your form to the PathFactory platform using its updated embed code

  3. Change the form’s embed code so that it grabs the visitor’s email

    Note
    See below for the step-by-step tutorial!

Step 1: Build a form in HubSpot

  1. Use the HubSpot forms tool to create your form.

  2. Copy the form’s embed code.

    Note
    Read this article if you’re not sure where to find the embed code.

Step 2: Add the form to PathFactory

  1. In the PathFactory Form Library, create a Custom HTML Form.
    image

  2. Use the form’s embed code that you copied from HubSpot in the Custom HTML field.
    image

Step 3: Change the embed code

  1. You will need to make some modifications to this code when using it in PathFactory.

    Note
    These changes will allow PathFactory to grab the visitor’s email address upon form submission. This can then be used to identify the visitor within PathFactory and associate their engagement data with their email.

    image

Sample form embed code

<!–[if lte IE 8]>

<script charset=”utf-8″ type=”text/javascript” src=”//js.hsforms.net/forms/v2-legacy.js”></script>

<![endif]–>

<script charset=”utf-8″ type=”text/javascript” src=”//js.hsforms.net/forms/v2.js”></script>

<script>

 hbspt.forms.create({

   portalId: ‘4224896’,

   formId: ‘098b2c66-6676-489b-a858-5f629aabaab6’

 });

</script>

Modifications

Add the following before the embed code:

<div></div>

<script src=”https://code.jquery.com/jquery-3.2.1.min.js”></script>

And add the following after the formID:

,

  onFormSubmit: function($form) {

     var email = $(“input[name=’email’]”).val();

     setTimeout(function(){

     window.parent.postMessage({

       conversionUrl: document.location.href,

       referrer: document.referrer,

       email: email,

       lookbookExternalForm: true

     }, “*”);},500)

     return true;

   }

 

Modified sample form embed code

<div></div>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
  hbspt.forms.create({
portalId: "4224896",
formId: "098b2c66-6676-489b-a858-5f629aabaab6",
   onFormSubmit: function($form) {
      var email = $("input[name='email']").val();
      setTimeout(function(){
      window.parent.postMessage({
        conversionUrl: document.location.href,
        referrer: document.referrer,
        email: email,
        lookbookExternalForm: true
      }, "*");},500)
      return true;
    }
});

</script>

Updated on September 15, 2022

Was this article helpful?

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!
CONTACT SUPPORT