Mar 1, 2024

Integrate 6sense & Google Analytics

The 6sense homepage.

Why is 6sense valuable?

6sense is a tool that does a ton of things, but one interesting use for content marketers is that it shows what companies are visiting various pages on your blog. And you can take it one step further by integrating 6sense with Google Analytics so that you can run all your regular reports together with company data.

Why is that useful? For example, if you can show that certain blog posts are attracting people from companies that are in your ideal customer profile, that's really helpful in terms of demonstrating the value of what you're writing.

You can also share this data with your sales team for prospecting and engaging with potential customers. For example, you can let them know that a company that they've engaged is actually coming to the site. You can see what pages those leads are looking at and therefore what topics they might be interested in.

Step 1: Add the 6sense tag to your site

After you sign up for 6sense, you need to add the 6sense tag to your site.

Adding the 6sense tag to your website in Google Tag Manager.

You can obtain the necessary script from 6sense documentation: It looks like this:

The 6sense installation script.

This script is available in the user interface:

The 6sense installation script continued.

(You can also ask your customer success manager for these things.)

Once you've done that, you'll see that there is a callback variable here called processEpsilonData:

6sense 5 epsilon png

Anything in our processEpsilonData function will fire after 6sense has gotten its data. We’ll take advantage of this to fire a custom event that tells GA4 we have company data available.

Step 2: Add a trigger for 6sense data acquisition completion

Next, you need to add a trigger that signals that 6sense has data available to send to GA. The trigger is the 6sense Custom Company Details Loaded Event.

Adding a 6sense trigger in GTM.

Ensure that there's a trigger type (ie “Custom Event”) and an event name.

Step 3: Hook up Google Analytics

The last step is to hook up your Google Analytics so that it fires after the 6sense Company Details Loaded Event happens.

Firing Google Analytics after the 6sense event happens.

Why is this important? Because we need this to fire after we have 6sense Company Details. We can't just fire Google Analytics 4 by itself. If we do that, then we won't have the data from 6sense and therefore all of these fields will be empty.

Take your Google Analytics 4, change the triggering to this new 6sense Company Details Loaded Event (as shown above).

Adding 6sense variables in GTM.

Next, go into Variables. Add a variable for each thing that you care about, such as company name, domain, company state, and employee range. For example, here’s what it looks like to add a variable for company name.

6sense 9 company_name png

It's going to trigger off a data layer variable name of company name. All of these come from here:

6sense 10 variable png

We did a window data layer push and we pushed company_name. If you wanted to get Domain, you'd add one called Domain.

If you wanted to get Domain, you'd add one called Domain. If you wanted to get Company State, you'd add one called Company State.

Those would all be new variables where you would put the data layer variable name here.

And then the name of this within Google Tag Manager is whatever you want to call it. In this case, it would be 6sense company name.

Setting up a 6sense “company name” variable in GTM.

And then you go back to your Google Analytics 4 tag, and you add company name there:

6sense 12 GA4 company png

And then you add 6sense company name there:

6sense 13 GA4 6sense company png

Do that for whatever variables you want. And then when you hit preview:

6sense 14 tag manager png

And you use the Google debug view or the debug Chrome extension.

You will see that under page view, setting it to undefined, scroll down. You'll see event parameters.

6sense 16 undefined png

Company name is Ercule.

Step 4: Create custom dimension in Google Analytics

Next go to the Custom Dimension section in Google Analytics.

You need to create a custom dimension:

Setting up Google Analytics custom dimension.

So here it's called company_name. So you go to the Dimension Name. We’ll enter our example: “company_name”. And in the Event parameter as well: “company_name”.

Naming the Google Analytics custom dimension for “company”.

This allows you to use the data in reports. The custom dimension should have the same name as the data layer variable name.

And once you do that, you're going to be able to use company_name in reports in Google Analytics 4. Repeat for any other data you’d like to see in GA.

We’re *actually* here to help

We’re marketers who love spreadsheets, algorithms, code, and data. And we love helping other marketers with interesting challenges. Tackling the hard stuff together is what we like to do.

We don’t just show you the way—we’re in this with you too.

Background image of a red ball in a hole.