1. Home
  2. Forms
  3. Hubspot Forms
  4. Using a Content Track as a Hubspot Form Confirmation Page

Using a Content Track as a Hubspot Form Confirmation Page

Summary

If you’d like to have a Hubspot form (on a landing page or web page) redirect visitors to a content track you can follow the instructions in this article.

This article covers:

  • How to redirect form fills to a Content Track

Scenario:

  • You have a Hubspot Form
  • You want to send visitors who fill out the form to a Content Track rather than a static Thank You page
  • You want those PathFactory visitor activities to be tracked and the data to be sent to Hubspot

Redirect Form Fills to a Content Track

  1. Create a form in Hubspot. This form will serve as the gate to your content track. Place this form on a landing page or web page using the embed code. Your embed will look something like this:
    Example Hubspot Form Embed Code

     <script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js">script> <script>   hbspt.forms.create({ 	portalId: "4989506", 	formId: "7035c852-15f2-4f63-91b4-8811de8e75de" }); script>
  2. Add a comma after the formId line and then add the following line of code afterward:
    onFormSubmitted: function($form) { window.location.href="PFTRACKURL&lb_email="+$form.find('input[name="email"]').val();             }

    PFTRACKURL is the URL of the content track you’d like to redirect the visitor to. This URL should contain a ‘?’ character. If it does not please use the following line of code after the formId instead:

     onFormSubmitted: function($form) { window.location.href="PFTRACKURL?lb_email="+$form.find('input[name="email"]').val();             }
  3. Now your form embed code should look like this in full. Everything in red has been added to have the form correctly redirect to the content track:
    image

Test Form Redirect

Note
Test to ensure this sequence of steps works as expected.
  1. Render the Hubspot form created in Step 1 in your browser and fill it out.
  2. You should be redirected to your content track. Spend some time viewing the content in your track and thirty minutes after you close your session check back to PathFactory track analytics to see your session information assigned to an email.

    For Example
    I filled out a Hubspot form that redirected me to my 2019 NBA Champions content track and spent some time viewing a few assets. I can see my engagement data in PathFactory assigned to the email I used in my Hubspot form submission (tara@pathfactory.com).
    Engagement data for this session also appears in Hubspot on the contact record of the visitor. You should see this data in the contact properties for the visitor that filled out the form.
    imageExample of a Hubspot form result

Updated on May 29, 2023

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