Enabling Sales Teams by Syncing Product Data into Hubspot
Learn how to grab product metrics from your product database and generate queries that will expose that data in Hubspot to enable your Sales teams
Pedram Navid
May 3, 2021
5 minutes
If you've gone with a simple text field, then you're done! If you're using the Multiple Checkboxes option, like we are, you'll want to add all the possible options like we have.
Step 3: Create a Hightouch Model With Your Product Metrics
The next step is to create a Hightouch Model that queries your database for your metrics. This step will vary depending on how your data is organized. Some organizations might have a very clean table with all relevant tables, others may need to do some SQL joins to get the right data.
The output should be one row per customer, and one column per metric.
If you're using multi-checkboxes, you'll need to combine all values into one row, separated by a semi-colon. In this example, we use [string_agg
in Postgres](https://www.postgresql.org/docs/12/functions-aggregate.html). Snowflake has LISTAGG
which works similarly.
In the example below, we join our sources
and destinations
to our workspaces
, combining all sources and destinations into one row, separated by a ;
with sources as (
select
workspace_id,
string_agg(source_type, ';') as sources
from sources
group by 1
),
destinations as (
select
workspace_id,
string_agg(destination_type, ';') as destinations
from destinations
group by 1
),
select
workspaces.id as workspace_id,
workspaces.name as workspace_name,
destinations,
sources,
from workspaces
left join sources on sources.workspace_id = workspaces.id
left join destinations on destinations.workspace_id = workspaces.id
where workspaces.type != 'demo'
Use your handy preview to feature to confirm your SQL is outputting correctly.
Step 4: Create a Hightouch Sync
Next up, we create a Sync which connects the model we built with our Hubspot integration. Pick your model and Hubspot destination, and you'll be presented with the Configuration Page.
- Select the object to sync to. We're picking companies. This should match the property you created in Step 2.
- Choose if you want to upset or update. In our case, we only want to update existing records, so we picked update.
- Select how you will match records between your model and Hubspot. We're matching on Workspace_name to Hubspot's company domain.
- Select the additional properties to map your metrics to. We've picked the Sources and Destinations.
- Next up, pick your Interval. We've opted to Sync every 5 minutes. Our first Sync will update all records, but each subsequent run will only update anything that's changed since the previous run, ensuring we don't run into any API Usage issues.
Step 5: Sit Back and Enjoy the Show
From here we'll take care of the rest. We'll fetch the data for the first run, update Hubspot, and then keep things in sync every five minutes for you. You can monitor the progress from our Sync page.
Once the Sync is complete, you can visit HubSpot and look for the newly-updated properties. You might have to scroll down to "View All Properties" to see all properties, and then click Add to Your View to have them visible. You can also use these properties in reports and views as well.
Wrapping Up
As you can see, getting product information into HubSpot can be really powerful with Hightouch. With just a few lines of SQL and a few clicks, we were able to get product information into the hands of our sales teams. From here, we can even take it a step further and start powering email automation that is personalized and unique to your customers. With minimal engineering effort required and low maintenance, anyone can update these models as your needs evolve.