Hi everyone! In this video, I'm going to show you how to integrate PrestaShop eCommerce with HubSpot. If you look around, there aren't many modules that can do this, and based on my research, I haven’t found a good one. So, the solution I found to be the best is using Integromat. I'll show you how you can do that.
To get started, you need to sign up for Integromat – there’s a link in the description below. Of course, you also need to have a PrestaShop solution and a HubSpot account.
First thing you need to do is go to your PrestaShop, under Advanced Parameters, and then click on Web Services. You need to make sure your web services are enabled and also enable CGI mode for PHP. After that, you need to add a web service key. Click on Add Key, generate the key, and give it a description. I’ll use "Integromat Key" for now and will give it all the permissions. Then, click Save. This is the key you'll use to connect to the API.
Next, go to Integromat. There is a link to some tutorials about Integromat in the description below if you haven't used it before, and I recommend you check those out. Click Start New Scenario, then select PrestaShop, and also select HubSpot and HTTP. I'll explain why I selected HTTP later. Click Continue.
We're going to start with PrestaShop. What we want to do is, every time an order is placed, we want to create a deal inside HubSpot, but we also want to transfer the customer data. If the customer isn’t already in HubSpot, we want to make sure we create it.
We’re going to watch for orders. So, for every order that comes in, we'll move that order from PrestaShop to HubSpot.
First, we need to set up the PrestaShop connection. I’ll put in a demo, then paste the key here. I also need to copy the URL, which is going to be your site URL. In my case, it’s just an IP address because I don't have a domain associated with this instance.
For now, I'll keep it to return only one order, but we’ll change that later. Click OK, then select the first order you want to sync. I'm just going to take the last one. It doesn’t really matter, I just want to see some data coming in.
So, now you’ll see the order was created on March 28th, and that’s the total paid for the order. What you'll notice is that you don’t have any details about the customer, except for the customer ID. To get those details, we need to add another module for PrestaShop to get the customer information. We’ll use the same connection and map the customer ID parameter from the previous module.
Next, let’s run it again. Select the first folder to process, and choose the last one. You’ll now have the order details along with the customer details.
However, when you look at the customer details, you’ll see there’s no phone number and no address details. So, for that, we need to add the address module to fetch those details. One of the issues with the PrestaShop modules here is that there’s no way to specify which address you want when using the standard module. Since the order has an address ID, we want to get that address. If the customer has multiple addresses, we need to use the HTTP module to create a direct connection to the API.
For that, create a basic authentication request using the HTTP module. Add the credentials and use the generated key here. Then, add the URL. If you’re accessing addresses, append /addresses
to your URL. You’ll use a GET request and parse the response. Make sure to click to parse the response if you want to get clean data.
Now, let’s test it. You should get a 200 code, meaning it's working fine, and the response will show all the addresses. We want to make sure we get the address linked to the order, so we add the address ID for the delivery address. Click OK.
Select the last order again to fetch the data. This will give us the delivery address details.
Next, let’s create the contact in HubSpot. Search for "Create or Update Contact" in the HubSpot module. We need to make sure if the contact is not already in HubSpot, we create it, and if the contact exists, we update it.
Once the connection is set, we’ll add the contact information, including city, email, first name, last name, and mobile phone number. Since PrestaShop doesn't always format the phone number properly, we'll add a phone number parsing module to clean up the phone number and format it into a standard version (E164 format).
Now, let’s map the mobile phone number to HubSpot and add the rest of the details.
After the contact is created, we need to create a deal. So, search for the "Create Deal" option in HubSpot and map the order data to it. You’ll include deal information like amount, deal stage, and deal name. For the deal title, I like to use the order reference ID, so I’ll map that as well.
To ensure the deal is associated with the contact, insert the contact ID in the deal creation process. If you also want to associate the deal with a company, you’ll need to create a company module beforehand and link the company to the deal.
Once everything is set up, we can process all the orders. Be mindful that, for deals, we’re creating new deals for each order, and for contacts, we’re creating or updating them.
You can test by running a scenario to check if everything works correctly. Once it's set up, Integromat will automatically process future orders at regular intervals. I generally use an interval of 2 hours for regular checks.
So now, if a new order comes in, Integromat will automatically move it to HubSpot.
And that’s all you need to do to synchronize future orders to HubSpot! If you need any help or want to give feedback, feel free to leave a comment below.