HubSpot Integration

To send information to HubSpot on events such as page views, content completions, and ecommerce purchases, just follow the following steps:

  1. Retrieve the HubSpot tracking code.
  2. Create events in HubSpot you would like to track (e.g. Course Completion, Ecommerce Order)
  3. In Settings > Tracking Scripts, add the following scripts in the designated areas.

Header Scripts

Add the tracking code retrieved in step 1. It should look something like the following:


<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/XXXXXX.js"></script>
<!-- End of HubSpot Embed Code -->

Sending Page View Events

To send an event to HubSpot whenever a page is viewed in Thought Industries, add the following script to "Page View Scripts":


<script>
_hsq = _hsq || [ ];
_hsq.push(["identify",{
email: '{{email}}',
firstname: '{{firstName}}',
lastname: '{{lastName}}'
}]);
_hsq.push(['trackPageView']);
</script>

Sending Ecommerce Order Events

To send an event to HubSpot whenever an order is placed in Thought Industries, add the following script to "Order Confirmation Scripts", replacing "XXXXXX" with the Event ID you configured in step 2:


<script>
_hsq.push(["trackEvent", {
id: "XXXXXX",
value: null
}]);
</script>

Sending Content Completion Events

To send an event to HubSpot whenever a course is completed in Thought Industries, add the following script to "Order Confirmation Scripts", replacing "XXXXXX" with the Event ID you configured in step 2:


<script>
_hsq.push(["trackEvent", {
id: "XXXXXX",
value: null
}]);
</script>