This tutorial will take you through how to use HubDB tables and Programmatic Email Modules to customise and personalise Google Review links. This solution will work best for businesses that have multiple locations, and is a great solution if you are looking to send multiple review links en masse.
You will need a Marketing Enterprise or CMS Professional / Enterprise subscription in order to use the HubDB table. You will also need Marketing Hub Professional / Enterprise to use the programmatic email modules.
You will also want to ensure you are tracking which location your customer is serviced at within HubSpot. The best way to do this is to create a Location Code property in HubSpot, and ensure it is populated in on the Contact object.
HubDB tables are basically like an Excel Sheet, except cooler. If this is your first time creating a HubDB table check out this article first, before moving on.
Now, each table has multiple ID's you need to be aware of:
These ID's can be used in code to tell HubSpot what it needs to do.
For this specific use case we want to create a table with the following columns: Location, Location Code and Google Review Link. I would recommend creating this in a Spreadsheet first and then importing it into HubSpot, especially if you have a bunch of locations.
After that, your table should look a little something like this:
⚠️ Important Note: The location code or location name must match your contact's location property exactly. For example if you contact’s location is “Ashgrove” on their contact record, but HubDB says “Ashgroove” - it will not work.
I have some good news for you non-coders out there. I have created the code you will need for this so all you need to do is copy and paste! You will need to do a bit of replacing but I will take you through it.
(a) First, let's create a programmatic email module. Go to Marketing → Files and Templates → Design Tools.
(b) Now, in the design tools screen, select Create a new file → Module → Next. Give your module a name, select "Emails" in the list of where you would like to use this module and place it in a folder.
(c) We need to set this module to programmatic. On the right hand side you will see a toggle for the module to be used programmatic emails - toggle this on.
(d) Now, you are going to copy and paste the following code into the blank code document. But first we want to replace anything in red. The following guide is listing in order of the code.
i) Replace 7586823 with the ID of your table. You can find this on the HubDB listing page.
ii) Replace the first location_code with the ID of the column listed your location code. This is the column that needs to match the Location Code Property. You can find this ID within the HubDB table by selected the arrow next to the column name.
iii) Replace the second location_code with the ID of the Location Code property. You can find this in the property settings.
{% if contact.location_code %} |
That's it you've done it - click Publish!
Now when building you email, simply drag and drop the module into your email. You can test it is working by going into preview and selecting a random contact to ensure it is showing the correct Google Review Link.