Updated on September 5, 2019, to include new examples and insights.
A challenge we’ve seen all too often in the world of analytics is the minimal visibility clients have into their true return on investment—not just an ROI on how many leads were captured, but how many qualified leads were captured and how many of those turned into actual sales. ROI for actual sales is necessary when reporting on return by channel, determining paid budgets, and discerning the amount that can and should be invested in acquiring and keeping your customers.
These insights are actually available, and are a result of what we call “Closed-Loop Analytics,” which links your website data (campaign clicks, acquisition sources, on-site conversions, etc.) with your CRM data (lead status, closed sales, etc.). In this blog post, we’ll walk through how to set up Closed-Loop Analytics by integrating Google Analytics and HubSpot data.
Note: The general process of capturing this type of data can be applied to other platforms. However, for this post, we’ll be going through the specifics of integrating HubSpot with Google Analytics.
When to Set Up Closed-Loop Analytics
Although Closed-Loop Analytics can be of use to any site, it’s particularly helpful for businesses with long sales cycles, when sales occur offline, and ones where most of the leads captured online don’t typically result in sales. If you’re using a CRM like HubSpot, you have the ability to track the status of different leads and mark them for follow up. Connecting that lead data in HubSpot with Google Analytics allows you to accurately credit channels and campaigns for website leads that have the potential to become sales and even those that actually become final sales.
Closed-Loop Analytics also results in more accurate lifetime value metrics in analytics platforms, such as Google Analytics. This type of information empowers you to make data-backed decisions into how much a customer is worth investing in acquiring and retaining. For example, you could use Google Analytics to see which whitepapers were downloaded by your MQLs from HubSpot and justify investing more resources in creating more of that type of content.
There’s an abundance of data that can be gathered, aside from what’s already been mentioned. Using Closed Loop Analytics, you can segment user data by lead status or field form, discern trends among the most qualified marketing leads, and identify the source that drives the most leads long-term. And you can then use all of this data to create Google Ads audiences and optimize towards them; using this information to fine-tune your marketing efforts.
How to Integrate HubSpot with Google Analytics
Broken down, Closed-Loop Analytics is the process of tracking individuals through Unique Identifiers (UIDs) in your analytics platform, sending the UID through your form to your CRM, and then marrying the data either back in your analytics platform or a reporting platform, like Google Data Studio.
You can gain all of these insights through five steps:
- Prepare your analytics platform to capture the UID
- Capture UID using a tag management system
- Customize forms to send the UID into your CRM
- Export CRM data for use in the analytics platform
- Begin building reports and analyzing data
Prepare Google Analytics to Capture Hubspot Data
In Google Analytics, we’ll configure your property to capture your UID and additional dimensions from HubSpot, then create your data set to capture these dimensions.
To create your custom dimensions, navigate to Admin > Property > Custom Definitions > Custom Dimensions, then hit +Custom Dimension. This is where we’ll create a custom dimension that’ll capture our UIDs and associate them with each individual user we track in Google Analytics.
Name your custom dimension, set your scope as ‘user’ (so the UID will persist among sessions and not just within a session), and take note of the index number that’s provided.
This is when you can add in additional custom dimensions that you’ll send back into GA from your CRM. For example, you may want to capture and associate Lead Status, Interest Indication, or Company. Following the same process for the UID custom dimension, create new custom dimensions for every piece of information you’d like associated with your users in GA.
Next, we’ll create your data set with the dimensions to import from your CRM. Navigate to Admin > Property > Data Import in Google Analytics and click ‘Create.’
Configure your data set to the specifications shown above:
- Type: User Data
- Name the data set and select the GA view for importing
- Set the Join Key as your User ID custom dimension
- Select the custom dimensions that were created to capture your CRM data
- Select ‘Yes’ to overwrite the data upon imports (this ensures that dimensions will update over time for the same user—for example, when a Lead Status changes from New Lead to MQL)
Once you save your data set, it will create an Excel sheet for you that’s formatted the way Google Analytics will be able to understand and import the data.
Setting Up User ID Tracking with Google Tag Manager
User ID Tracking is necessary to facilitate Closed Loop Analytics properly. This process results in unique, non-PII (no Personally Identifiable Information) UIDs for every user on the site. These UIDs are recorded every time the same user visits the site, stitched together for a full user view, and integrated with our CRM data.
Recently, Michael Wiegand, our Director of Analytics, published a blog post describing in detail how to set up User ID tracking for full visibility into online-to-offline attribution. Visit his post for in-depth steps on how to set up User ID cookies and capture them in Google Analytics.
Customize Your HubSpot Forms to Capture UIDs
Your HubSpot forms need to be updated to collect and tie together UIDs once they’re set up. The objective of this step is to grab the UID value and push it into a hidden field that’s submitted along with other lead information into our CRM.
- Navigate to Setting > Properties > Create Property
- Create a Custom Property, defining these criteria
- Set the Label and Internal Name as ‘ruid’
- Navigate to Marketing > Lead Capture > Forms
- Create a new ‘Single-line text’ field
- Set the ‘Field Label’ as ‘ruid’ and configure the rest of the fields as shown below:
- Save the field
- Edit the field by clicking on it and check the box that says ‘Make this field hidden’
Integrate Your HubSpot and Google Analytics Data
Once the User IDs are collecting in Google Analytics, passing through to your CRM, and your analytics property is set up to capture this data, we can begin integrating the data.
There are two options to marry this data:
- Export the data from HubSpot and import it into Google Analytics, or
- Create a Google Data Studio Report
Import HubSpot Data into Google Analytics Reports
To import CRM data into Google Analytics, we have to export the data we want from HubSpot and format it into the Excel sheet that was provided from our data set. This is set up through the following steps:
- Download your HubSpot data by either:
- Downloading an add-on in a Google Sheet and entering your HubSpot API key or,
- Custom exporting the data from HubSpot
- Set up your data pull to pull all lead fields
- Scrape the desired data out of the raw data
- Format the output to match the data set sheet from Google Analytics
- Download the sheet as a .csv
Once you have the data formatted properly, we can import it back into Google Analytics:
- Navigate back to Data Import in Google Analytics (Admin > Property > Data Import)
- Click on ‘Manage Uploads’
- Click ‘Upload File’
This will take a minimum of 24 hours to upload and parse data properly. You’ll want to create a cadence for this process to update lead dimensions, such as lead status, and to add new leads to your Google Analytics data.
Create a Google Data Studio Report
The aforementioned blog post, Online-to-Offline Attribution Made Simple—as simple as it can get, really—also dives into how to connect our HubSpot Google Sheet with a Google Analytics data source into a Google Data Studio report.
What to Do with Integrated CRM and Website Data
After you’ve completed these steps, your HubSpot data will be connected to your Google Analytics data either through Google Analytics or Google Data Studio! You can begin analyzing this data for ROI, lifetime value, or build audiences in Google Ads to begin optimizing for more targeted audiences.
View User Data in Your Reports
First, try pulling in User IDs as a Secondary Dimension alongside other dimensions in your reports to begin identifying trends.
Play around with different combinations and reports, looking at your important metrics, such as submitting forms on the site.
Next, replace your User IDs with custom dimensions you created from your CRM. Dimensions such as Lead Status, for example, can be analyzed to identify the “unicorns” on your site.
Locate these users and figure out how to optimize your site and marketing efforts to attract more of them.
Inform Other Marketing Efforts with Your Data
The most obvious use of this data is viewing the performance of your site’s content. For example, view Lead Status paired with Landing Pages and Most Visited Pages on your site to identify which pieces of content are bringing in new, high-quality traffic and eventually converting your users.
Once you’ve identified your “unicorns,” scrutinize them and see what they all have in common in their user behavior. Viewing your content alongside these users’ behavior will allow you to identify commonalities among what should be your “evergreen” content (content that is always relevant). Use these analyses to push this content forward and make a case to invest in more content that is similar.
Keep in mind that there’s plenty you can do with the wealth of data you now have and it’s not strictly limited to on-site optimizations. You can use this data to optimize your paid efforts, for example.
Create Google AdWords audiences in Google Analytics with options you’ve never had access to before. Build your audiences and create retargeting lists based on Closed Leads or Marketing Qualified Leads. You can now begin optimizing your paid campaigns for only the groups of users and campaigns that result in high-quality leads and cut out wasteful spending on users that become disqualified leads.
For businesses with a long sales cycle, high conversions, and low actual sales, the additional CRM dimensions offer unmatched visibility for the long-term. View your CRM dimensions alongside your Google AdWords campaigns in Google Analytics to identify the campaigns that are actually bringing in high (and low) quality leads over time.
Regardless of what you end up doing with the data, it’ll provide you a new level of visibility you’ve been restrained from before. Even if you’re still debating how this wealth of information could be useful specifically for you, get started on collecting the data; the more you collect, the better. I assure you, it will eventually answer important questions for you in the future.