How do I integrate my eCommerce shopping cart with HubSpot?

Last updated: January 31, 2018

Available For:

Marketing: Free, Starter, Basic, Pro, Enterprise
Sales: Free, Starter, Professional
Service: N/A

HubSpot has several options for integrating with eCommerce platforms. A list of all in-house and third-party HubSpot integrations can be found here. In addition to third-party eCommerce integrations, HubSpot offers a native integration with Zapier, a third party service that offers simple API integrations with over 250+ services, including many eCommerce sites.

Please note: all third-party integrations are supported by their developers, and have a support email address listed on their respective pages.

A secondary option is to have a custom integration built. Please note that this is a custom method that requires the assistance of a developer. HubSpot's Partner Directory features many service providers that would be happy to work with you to create a custom eCommerce integration that fits your needs. To find a partner to build your custom integration, click the Graduation Cap > HubSpot Partner Directory at the upper right of your HubSpot portal.

When building a custom eCommerce integration, your developer will want to use the Forms API, the Contacts API, and the Deals API.

The goal of integrating your shopping cart solution is to A) create a double post from your checkout forms to HubSpot and your shopping cart database B) create a data sync between the two systems so that customer data stays current in HubSpot if there are updates in the shopping cart database. 

Once complete, you will see new contacts being created in HubSpot based on their progress in your store’s checkout flow. Additionally, you will be sending purchase and lifetime data to HubSpot which can then be used for your inbound marketing campaigns.

Create contact Properties and set up the Contacts API

With the contacts API you can create a sync of customer field data between your shopping cart database to HubSpot. This will allow you to keep your HubSpot database up to date with customer purchase data for marketing and reporting.

The first step to connecting your shopping cart database to HubSpot is to determine what fields you would like to pass, and then create these fields in HubSpot. It is important to consider syncing the data fields from your shopping cart database that are valuable for marketing campaigns and reporting. For a list of example properties and property groups, check out this article.

  • Once you have your list of fields you would like to sync into HubSpot from the shopping cart database, navigate to Contacts. Click the Actions dropdown menu and select Edit properties
  • Click Create a Property in the top right and begin creating your new custom properties. When creating these properties, be sure to select the correct Field Type for the values you'll be collecting. So, for example, if the property is Date of purchase, the field type should be Date Picker. Also consider creating Property Groups for organizational purposes. 

  • When all of your fields are created in HubSpot, map them to your shopping cart database using the create or update contact API endpoint. 

Create HubSpot forms and set up the Forms API

With the Forms API you will connect your non-hubspot shopping cart with HubSpot so that when a customer submits the checkout form the data posts into your shopping cart AND into HubSpot. Additionally the Forms API will allow HubSpot to register the form submission on the HubSpot contact timeline for segmentation, workflow enrollment, and reporting.

Please note: The steps below will only be available for Marketing Basic, Pro, or Enterprise customers. If you are a Sales or Marketing Starter user, it is recommended you use the Contacts API as instructed above.

Follow these steps to integrate your forms: 

  • In your HubSpot Marketing BasicProfessional, or Enterprise account, navigate to Contacts > Forms.
  • Create “dummy forms” in HubSpot. The most important part of this step is naming each form appropriately to match your checkout flow. So if you have a multi-stage checkout flow, you should create a form for each step i.e “Checkout Started”, “Checkout Completed” etc.  
  • When you create a form in HubSpot, take note of the form GUID located in the URL of the form screen. This is what is referred to in the Submit Form Data API endpoint.

  • When integrating your forms using the Forms API, be sure to use the “HS CONTEXT” parameter in the optional parameters section of the API documentation. This is what passes the HubSpot tracking token and enables analytics data (source, page-view, site visit etc) to pass via your shopping cart form submissions.  

Create Deal Properties and set up the Deals API

With the Deals API, you will be able to create individual “order summaries” for customers where each order creates a Deal record with associated data. This will enable date specific order segmentation as well as revenue reporting that will capture revenue figures from customers who place multiple orders within your reporting timeframe (requires the HubSpot Reporting add-on). 

First, create your custom deal properties:

  • Navigate to Contacts Contacts Settings
  • Choose Deal Properties in the left sidebar menu. 
  • Click Create a property in the top right and begin creating any custom deal properties. These properties should be all the information from individual orders that marketers will find valuable for marketing campaigns (segmentation, workflow enrollment, etc.) such as Order Product Categories, Order Total, etc.
  • Use the Create a Deal endpoint to map your deal properties and associate the deal to the contact via the “associatedvids” parameter.
Once your integration is complete you will see new contacts created in HubSpot when they checkout in your online store, data will stay up to date via the contacts API sync, and individual order summaries will be created on contact records.

Was this article helpful?