Defining Audiences with Google Analytics Custom Dimensions

/

Defining Audiences with Google Analytics Custom Dimensions

In 2012, Sayf introduced you to 20 useful ways to use custom variables. He provided five custom variables for each of the four main website types: Content Sites, Ecommerce Sites, Lead Generation Sites, and Self Service Sites.

These are all still applicable today, even though we refer to these custom data definitions as custom dimensions and metrics in Universal Analytics instead of custom variables.

Rather than provide you with 20 more ideas for custom data – my goal is to instead inspire you to take another perspective on custom dimensions. Whether you are redesigning your website, deciding on content for a landing page, or creating advertisements for digital or traditional media, it truly pays off to know exactly who your target audiences are.

You may already have a defined set of target audiences or even a handy list of well-researched user personas – wouldn’t it be great to be able to look at your GA data and instantly see which of your users belong in each of these defined groups?

Or, you may be in the process of refining your knowledge about your target audience and could use additional insight that could be provided by GA. Either way, we are going to look at a few different industry types and provide some ideas on using custom dimensions to help you discover more about your target audiences.

Setting a Custom Dimension

Before we jump into some of those industry examples, we’ll first briefly review how to set up custom dimensions.

  1. Custom dimensions must first be created in the Google Analytics interface. In your Admin settings for the property you would like to set a custom dimension in, select Custom Definitions and then Custom Dimensions:
  2. Custom Dimensions

  3. When you click the +NEW CUSTOM DIMENSION button, you will give your dimension a name and then select the scope of the dimension. The scope defines to which data the dimension will be applied – at the hit-level, user-level, session-level or product-level. For more information on scope, check out Google Developers documentation.
  4. Many of our examples will use user-scoped custom dimensions, as they are going to help us define audience members and we want to remember this audience any time they come back to the site. Keep in mind, however, that if you assign a user-level custom dimension to a particular visitor more than once, the last dimension applied will overwrite the previous value.

  5. Now that you have set up your custom dimension within the GA interface, you will need to get GA to populate that dimension with values that you define either via JavaScript on particular pages of your website, or, (our preferred way) via Google Tag Manager. Remember that custom dimensions must be sent to GA alongside another hit, such as a pageview or an event hit (regardless of scope).

Sending the Data to Google Analytics

When you send the information for this custom dimension to Google Analytics, you need to know the “index” number of the custom dimension that you just set up. This tells Google where to store the information you’re sending. As for the value, you’ll either need to pull this information from your server, or extract it from some action the user take, or infer it from actions or pages visited.

If you are going to do this with JavaScript on your webpage(s), the code might look like this:

Pageview hit example:

Event hit example:

If you are going to use GTM instead, you will need to either define the dimension entirely in a particular tag or utilize a dataLayer to set the dimension value programatically.

For example, if you have a GTM tag that tracks form submissions as a GA event and you would like to define users who submit the given form as belonging to the custom dimension of “Prospective Students,” you would simply need to add a custom dimension to the form event tag in GTM. Under More Settings in your form event tag in GTM, select + Add Custom Dimension and enter the index number assigned to the dimension within the GA interface and then add the value of “Prospective Student.”

cd-pageview2

If your custom dimension’s value depends on information programatically set by your server, you will need a data layer to allow GTM to grab those values and send them to GA with a particular hit. That dataLayer would look like this, where “Prospective Student” when the page is loaded:

This code needs to be placed just above your GTM container on applicable page. See more information on how to set up your data layer here.

Now that we have briefly described how custom dimensions can be defined, let’s look at some examples of how we can use them to more effectively understand the audiences visiting our websites.

Educational Institutions

Educational institutions typically are interested in audience categories such as these: Parents, Students, Prospective Students, Alumni and/or Donors and Military.
We could easily set up a custom dimension that declares users who view military-specific content as part of the Military audience by placing a custom dimension on pages containing military content because this section specifically applies to military members (active duty or veteran) – so we could be fairly confident in the accuracy of this custom dimension.

The other categories may not be as reliable, though. For instance, parents might browse through the Parent section of the site as well as the Student section of the site while searching for certain types of information, such as on-campus housing options, activities, etc. Therefore, it would benefit us greatly if we could collect user-entered data.

One way to do this would be to provide a drop-down box in the utility nav, for example, and let visitors select whether they are a parent, student, prospective student, alumni etc. This would let you cater the content the user is seeing to their self-identified persona, as well as allowing us to set a custom dimension based on their selection for use in GA.

iam

Then learn from their behavior and continue to customize and optimize your website, messages and advertising based on what you learn. If they navigate to other sections of the website after this selection you would still have their audience type saved in GA. Additionally, if the user submits a form to request information, have them choose which group they belong to as one of the form fields.

Retail

Say your company sells running shoes, and your marketing team has put together a couple user personas that describe your target audiences based on your brand identity. For fun, let’s say those personas look like this:

Cindy Single Mom: Her life is extremely busy between work and shuttling her kids around to their various after-school activities. Her kids are her number one priority, although she has started making time for herself as well. She recently started BeachBody workouts and eating healthy, and she promotes her healthier lifestyle to all her friends. She is now an avid marathon runner.

Demo: age 26-35, living within 40 miles of our store

Interests: kids, exercise, healthy eating, active lifestyle, running, marathons

Carly College Student: Carly is an active college student and avid foodie. She loves trying new restaurants and tries to choose healthier options whenever possible. She likes shopping with her friends and staying fit.

Demo: age 18-25, living within 40 miles of our store

Interests: gym, healthy eating, clothing

In this case, you cannot simply ask users which group they belong in. And, not every visitor to your website will exactly fit these two targeted personas. However, with some strategic effort we could start to recognize which users do belong in each category – and we could then start to look at our GA data segmented it by each persona.

For example, you could start by setting up a media campaign in Facebook. Create an audience list for each persona (targeting by geolocation, age, interest categories, relationship status, etc.). The promotional posts or ads should direct users to a page on your website that has a query parameter that defines the persona you are targeting. This piece of data can be captured as a custom dimension.

The example landing page that you would use might look like this:

www.example.com/landing-page.html?utm_source=Facebook&utm_medium=paidSocial&utm_campaign=BOGOpromo&persona=Cindy

To capture the persona as a custom dimension we will use GTM. First, in your Google Analytics property, define a custom dimension called “persona”. Remember the index key.

In GTM, create a new variable called {{persona}}. Set the variable type to “URL” and the component type to “Query.” The query key will be “persona.” This will populate the GTM variable with the value of the query string “persona.”

In your GTM pageview tag for Google Analytics, you will find Custom Dimensions under More Settings. Add a new dimension, apply the index number assigned to your persona custom dimension and as the value select the variable {{persona}}.

If you have a database of customers who have purchased in the past, and those customers have provided information about themselves (email address, zipcode, interest categories, etc.), you could create a Custom Audience in Facebook based on that data as well. You would then be able to cross-reference that data with Facebook’s data, which would allow you to not only target by interest category but also to identify age demographics as well as reach other individuals who look like each audience list you have defined (further growing your audience reach).

This approach may also be interesting to try out on brand advocates such as by targeting users who are subscribed to your company on Facebook.

Healthcare/Pharmaceutical

If your website exists to educate consumers about specific health conditions and pharmaceuticals that you make, you are likely targeting Doctors and Consumers alike.

Here’s an example of where a simple pageview custom dimension might work well since the content on your website is likely very specifically tailored for each audience. Consumers with a condition that could make them a prospective consumer for your product are going to generally avoid content geared towards doctors because it is typically full of legal and industry jargon; whereas doctors are going to need to review that information.

You may even have an option to let the user select which type of content they are looking for (“for doctors” vs “consumer info”), which would allow you to set a custom dimension based on that selection. Additionally, users that download specific pieces of content tailored to consumers may be labeled as such with a custom dimension (such as when they download a pamphlet or pharmacy request form, for example).

Banking

Another way to look at your audiences, which may be especially useful for banks, is from the perspective of customer lifecycles. For example, who is considering buying a home? Are some of their users looking for student loans or business financial advice? There are many branches of banking, each providing insights to an individual’s lifestyle and interest. You could set up custom dimensions that help define your users as types of audience members. Here are some example audiences:

  • Home Buyers (searching for home loans and mortgage rate
  • Students (searching for student loans and possibly interested in opening a checking/savings account)
  • Business (seeking financial advice and business loans)
  • Personal (interested in managing their checking/savings accounts online and personal loans)

Content areas viewed by users hint toward their area of interest, but we could be more certain by using a custom dimension that is defined by content collected from the user themselves – such as in a form submission. If an individual submits a form requesting for information about mortgage rates, they could be defined with a custom dimension as a potential home buyer. This would be a particularly interesting audience to look at in GA due to the ROI of potentially landing a mortgage loan. Additionally, if you are capturing data on logged-in users you may also be able to set custom dimensions based on that data as well (just like we described in the Retail industry example).

Another example would be identifying users interested in student loans. Prior to the start of a new semester, the bank could promote its student loans with various banners across the website or via promoted social media. When a user clicks on one of these banners and is directed to a landing page, a custom dimension could be set via either the pageview or with query parameters that identifies that user as a potential student. We could also remarket this user with advertisements to open a checking/savings account.

Parents of students may click on those banners as well, however, so it would be more accurate to define this audience based on user-submitted information, just like we described for potential home buyers, for example.

What’s Next:

Once you have set up some custom dimensions that help you identify your users, look for patterns in their behavior and oddities that signal that your dimensions may need further refinement. This should help provide more insights that you may otherwise would not have been able to generate and ultimately enable you to more effectively tailor your advertising to your audience.

Custom dimensions can be viewed alongside regular reports in Google Analytics as Secondary Dimensions, or you can use them to create custom reports, dashboards, or advanced segments.

Note – Sayf also provided us with a great post on how to see custom dimensions in your Analytics reports.

I hope these ideas encourage you to look at custom dimensions from a different perspective and try aligning them to your targeted audiences. Now it’s your turn – can you think of creative ways to identify your audience with custom dimensions?

Amanda Schroeder is an Analytics Engineer and comes from the marketing industry where she found a need for accurate, insightful data that could aid in making results-driven decisions. Amanda’s passion for building solid measurement strategies and connecting all the pieces of integrated digital and traditional marketing campaigns has led her to her current role at LunaMetrics.

  • http://towingnc.com Mariano Botto

    It’s not the old Dough Bakery spot. It’s the old Son’s Place spot.

  • shafeek

    Hi Amanda,

    Thanks for the great post.

    I tried to send the custom dimension with event hit, but not works.

    The custom dimension sent with page view hit is shown in my custom report.

    Kindly help

    • Amanda

      Hi Shafeek,

      It sounds like a tracking setup problem. Are you using Google Tag Manager to send the event? If so, I would check that the trigger is indeed working as planned. If you are using a variable for the custom dimension value, check that the variable is returning a value and is not undefined. If you are hard-coding the event tracking with the custom dimension, make sure the code is correct:

      https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets#sending_data

      Best,
      Amanda

  • Katya De Palma

    Hi Amanda thanks for this post, it’s very interesting!
    just a question: in your opinion for a website that using bet online, it could be a good solution using the custom dimension/metric like a tracking for all the bet/transactions? or the best way is to setting the ecommerce tracking like common way?
    many thanks for any advice
    Kate

    • Amanda

      Hi Katya,

      It sounds like ecommerce tracking would be appropriate for you – take a look at this post for a little more background on what it entails:

      http://www.lunametrics.com/blog/2014/09/18/faq-enhanced-ecommerce/

      • Katya De Palma

        hi Amanda, thanks for your support. Yep, I thought about the enhanced ecommerce, and maybe I can fix together with some costum dimension related about the user type. what do you think? I mean Enhanced ecommerce + CD (by user)
        many thanks for all!

        • Amanda

          Certainly! We do this often when we want to know what account type someone made a purchase with; such as when users are able to complete purchases with a store account, a social account or as a guest, for example.

  • Charlotte Taft

    This is super useful – thank you!

    A quick question – what if you want a custom dimension to be populated from data import where the KEY is a data layer set value (in this case, userid)?

    • Amanda

      Hello Charlotte,

      I’m glad you found this post useful! It sounds as though you want to import data to go along with the userid you’re getting out of the datalayer – correct? You cannot key off the userid itself, but as long as you also store that userid as a custom dimension you will be able to key off it and import new information.

      My colleague, Jim, wrote a step-by-step guide to data import:

      http://www.lunametrics.com/blog/2015/09/28/google-analytics-data-import-guide/

      Hope that helps!
      Amanda

  • http://www.saboresdeisrael.com.br Shlomi Asaf

    Hi Amanda, how are you? Thank you for this great post!
    For some reason I’m not able to see my custom dimension inside demographics repost. Do you know if it’s like that intentionally by Google? I see the custom anywhere else, but inside there I don’t.

    Thank you.

    • Amanda

      Hi Shlomi, I’m not sure I follow your question. I am able to apply a secondary dimension in the demographic reports to see my custom dimension, and I can apply a segment with a custom dimension. Could you please clarify your question?

      Thanks!
      Amanda

Contact Us.

LunaMetrics

24 S. 18th Street, Suite 100,
Pittsburgh, PA 15203

Follow Us

1.877.220.LUNA

1.412.381.5500

getinfo@lunametrics.com

Questions?
We'll get back to you
in ONE business day.