Google Analytics: Defining Users by Action

Mike Baranowski
November 18, 2015
Google Analytics now allows you to define customized audiences based on your website data. How can this improve your marketing? Find out at our agency blog.

Defining Audiences using Google Analytics Custom Dimensions

So you have Universal Analytics installed on your website as well as Google Tag Manager. You’ve tracked every possible action a user can take on your website. But your website serves different users and you can’t get a clear picture of the behavior of the users to make more actionable insights. Universal Analytics custom dimensions can help you silo users into different audiences that make sense to your organization. By segmenting users into different audiences, you can get a better sense of how each interacts with your website.

Defining Audiences

Before tracking the users can begin, you must define what audiences you care about and/or which audiences use your website. Is there an action a user can take on the website that would associate them with a particular audience?

For example, if your website has a login functionality that can be utilized by current customers, then we can make the assumption that if someone clicks on the login button they are returning while by default everyone else is a prospect user. Here we have segmented the website users into two simple audiences: ‘Current Customer’ v ‘Prospect Customer’. Another example can be directly applied to the Collective Measures website: if a user views the page ‘’ we can segment this user as a ‘Job Seeker’. We are using assumptions about what users can do on your website to help classify what audience they belong to. Keep in mind the simpler the assumption the easier it will be to assign users to audiences.

You may already have a defined set of target audiences or researched based personas that your company uses, but below are some examples of audiences that you can apply to your website and help jumpstart some brainstorming:

Customer Type – Prospect v Current

Organizational User – Customer, Employee, Job Seeker, Investor

Business Unit – Product Line A, Product Line B, Product Line C

Location Based – Sales Region or Store Location

What is a Custom Dimension?

With the audience framework established, it is now best to understand how a custom dimension can be utilized to track the audiences. Custom dimensions (and metrics) are a way to send custom data to Google Analytics that it does not automatically collect (phone call data, CRM data, etc). Custom dimensions can be used to track a variety of data points, even outside of just audiences, that can be viewed side by side with Google Analytics metrics in available reports. In this case the dimension ‘audience’ does not exist in Google Analytics, so we must define it, track it, and use a custom dimension to send the data into Google Analytics.

Creating the Custom Dimension

In this implementation, we are utilizing Google Tag Manager to take care of the brunt of the work so we don’t have to rely on IT resources but complete all tracking within the interface itself. Custom dimensions can be created without the use of Google Tag Manager as seen here.

  1. First, we must configure the custom dimension in the Google Analytics interface. The custom dimension settings exist in the Property settings of the Admin section. Navigate to the property to which you want to add the audience custom dimension and click new custom dimension.

Custom Dimension8

Then add a name for the custom dimension, select a ‘user’ scope, and select ‘active’. Scope determines how the custom dimension value with be associated. In this case we are defining users to an audience, so we select ‘user’. Here is more information regarding custom dimension scope.

Once created you will see the new custom dimension listed. Please keep in mind the ‘index’, which is always 1 if it’s the first custom dimension you’ve created. We will use this index later in the process.

Custom Dimension6

  1. Next come steps associated with Google Tag Manager. There are two basic ways to set up your audience dimension depending on how the users are segmented. You can define audiences by the actions they take or the pageviews they see or both! Obviously there are more methods in helping to define audiences, like the utm parameters in a URL or datalayers added to your website, but let’s start with the two methods below. Might as well use what you already have!

Creating audiences based on user actions

Going back to the example of tracking the ‘Current Customer’ audience based on a login button click, we first start by tracking the login button click. Once that Google Analytics event tracking is place on the login button, we can slightly tweak the tag itself.

In the ‘Configure Tag’ section of the tag go to ‘More settings’ and click on ‘Custom Dimensions’. Here we will add a custom dimension so that when a user clicks on the login button then the custom dimension will automatically be set to ‘Current Customer’. Also, remember that index number? Here is where you input that index number, so that Google Analytics knows which values are associated with which custom dimension. At the moment you may only have one custom dimension, but with every new custom dimension you will have to reference that new index number.

So for every user action that defines a user to an audience simply add the custom dimension to the event tag associated with that action.

Custom Dimension5

Creating audiences based on pageviews

Now going back to the example of tracking ‘Job Seekers’ who view the job page, we first start assigning the page to the audience by creating a lookup table. If you haven’t used lookup tables, well then look them up! A lookup table simply assigns values to certain variables. In the case of audiences, we want to assign a page to a certain audience.

In the ‘Variables’ section of GTM, created a new ‘user-defined variable’. Add a name to the variable and select the ‘Lookup Table’ type. Next for the input variable choose {{Page URL}}. In the example below you can see how the page URLs are the input and the audience assigned to them are the output. The example below is simple, but you can see that you could essentially categorized your entire website in to customer types, product audiences, business units, and more! (Hint: Use lookup tables for content groups)

Custom Dimension4

Next we need to send the lookup table ‘output’ into Google Analytics, so head over to the Google Analytics pageview tag. In the ‘Configure Tag’ section of the tag go to ‘More settings’ and click on ‘Custom Dimensions’. Here we will add a custom dimension so that when a user views one of the pages in the lookup table the output gets sent as the audience information to Google Analytics.

Custom Dimension3

You may be wondering, “What if my users take different actions associated with different audiences?” With the ‘user’ scope chosen, when two values (or audiences) are set within the same session, the last value becomes the audience for the current session and is applied to future sessions for the user. We would assume that in most cases users do not overlap between audiences greatly, but take caution depending on your organization. Possibly the hit or session level scope may be more appropriate. We are using the audiences to create directional insights rather than exact figures.

Using the Custom Dimension

Once the custom dimension has been tested and the Google Tag Manager container has been published now it’s time to view the data! There are several ways to both see this data and utilize it within Google Analytics. You can filter and sort the custom dimensions against metrics just like any other dimension in Google Analytics. You can view and use custom dimensions as secondary dimensions in reports in the Reporting Tab and as primary dimensions in custom reports.

A fun usage of your new audience dimension is to use it within advanced segments or use it to filter a view. Within the advanced segment select which audience you want to view and then apply that segment to any report. This way you can see behavior differences between your audiences.

Custom Dimension2

You can even completely separate the audience data by filtering on the custom dimension itself. Now different stakeholders can view the audience data specific to their interests. Below is an example of what that filter would look like:

Hopefully this abundance of information gives you the motivation to come up with your own ideas in segmenting users into audiences and then discovering insights related to their interests as well.

Share Blog Post

Related Insights