50+ Google Analytics Goals (2019)

Google analytics goals 2019

100+ New Google Analytics Goals 2019

This blog explains the 100+ new hacks for Creating and Organizing Goals Google analytics 2019.  And also explains how to set up a destination goal with a funnel 2019.

Google Analytics has four kinds of goals:

Google Analytics

Session Duration and Pages Per Session goals are based on those metrics exceeding a given threshold (the user spent more than 5 minutes on the site, or viewed more than 3 pages).

 

Event goals are based on events, the non-pageview interactions for measuring activities such as downloads, outbound links, or video plays 

 

In many cases, these goals are straightforward to create, based on the tags and triggers you’re already using in Google Tag Manager. However, in some cases where URLs don’t change, such as dynamic, AJAX-driven processes, you might require additional tags and triggers in Google Tag Manager to accommodate.

 

This blog explores the setup of goals in Google Analytics and any tags and triggers in Google Tag Manager that are necessary to deal with such situations.

 

 WHY SET UP GOALS?

why_goals

Notice that none of these goals represents actions by the user that aren’t already available in Google Analytics data. What good, then, are these goals?

 

First of all, creating goals forces you to actually think about why your site exists and what you’d like your users to accomplish.

 

Within Google Analytics, creating goals elevates these particular actions in importance in the way Google Analytics presents them in its reports.

 

Goal metrics such as conversion rate are easily accessible across all of the types of reports in Google Analytics, as well as enabling further analysis through tools such as the multi-channel funnel reports.

 

The accessibility of goal metrics in reports makes it easy and straightforward to make comparisons and find your most valuable audiences and marketing channels. Without goals, you’d have to dig harder, using segments and other tools in reports, to come to these answers.

 

You can also assign monetary values to the goals you create in Google Analytics, and there are metrics that let you compare these values in your reports as well.

 

If there are actual purchases being made on a website, you can capture those with e-commerce tracking; but for other types of sites, you may still be able to assign a real-world value to the goals.

 

For a lead generation process, for example, you may be able to gather data from outside Google Analytics (out of 1000 leads from the website over the last year,10% resulted in a sale, and the average value of a sale was $500), resulting in an average value per lead (in this case, $50, if you do the math).

 

Alternatively, if there aren’t any conversions on your site that you can tie to real-world monetary values, you can still use the goal values as a way of weighing their importance. Maybe your primary goal is $100, a couple of secondary goals are $50 each, and some minor goals are $10 each.

 

Creating and Organizing Goals

goal

Goals are created within each view in Google Analytics. You’ll find any goals you’ve created and the ability to create new ones in the view column of GA’s Admin settings 

 

Setting up goals, like any other changes to the Admin settings in Google Analytics, does not retroactively reprocess existing data in reporting views. Creating a goal will measure conversions for that goal going forward.

 

CREATE A GOAL IN GOOGLE ANALYTICS

Google Analytics

 

Deleting Goals

If one of your goals is no longer relevant, you can disable it with a toggle in the list of goals, which hides it from view in your reports.

 

Notice, however, that there is no option to delete a goal. Like all Google Analytics data, once data is in reports, there’s no going back in time to change it (including deleting the existing goal data).

 

You can, however, reuse the slot for a goal by simply changing its name and all of its settings. From that point forward, data in that goal’s slot will be for the new goal, and backward for the old.

 

Tip there’s no indication in GA’s reporting interface when a goal’s setup has changed, so you should provide an annotation, and consider including a date in the goal’s title to be clear about changes.

 

Setting Up a Funnel

funnel

Before setting up the goal funnel, you’ll need to know the URL of each step in the process. Depending on what the process is, it might be easy to walk through on the site (fill out the contact form and say “Sorry, just testing”) to see what the URLs are.

 

In other cases (purchases, account registrations, etc.), the processes may be more complex or difficult to test. You may need to use a test version of the site or consult your documentation or developer to understand the process and the sequence of URLs involved.

 

In some cases, you may encounter a sequence of steps that don’t have any distinction between URLs. You’ll explore how to tackle these later in the blog.

 

CREATE A DESTINATION GOAL WITH A FUNNEL

Assuming you’ve already gathered a list of URLs of the steps in your process, let’s set up a destination goal with a funnel.

 

1. For a Destination goal, the first goal detail setting to enter is the final URL destination for the goal

 

2. Enter URLs here just as they appear in reports in Google Analytics, typically beginning with the path (excluding the hostname). There are three matching options:

 

  • Equals to: The URL must match exactly what is entered, no more and no less. This is the default and works fine in many cases, but where you need more flexibility, the next two options are available.

 

  • Begins with: The URL must begin with the string entered but could continue with additional text at the end of the URL. This is quite useful for URLs that have many possible variations according to the user making a choice or entering information in a form. 

 

  • Regular expression: The URL must match the regular expression pattern. This allows a large degree of flexibility for matching patterns from general to specific.

 

3. You also have the option whether the URL you entered should be case-sensitive (which is almost never needed).

 

Required First Step

Google Analytics

Finally, there’s one additional option that useful in some scenarios: the required step option on the first funnel step. Notice that the funnel reports show users entering the funnel at any step in the process. Often, that’s the first step, but it could be a subsequent step.

 

How does this happen? You may think it’s not possible; there’s no way to get to Step 2 of the registration process without going through Step 1! Nevertheless, it can happen in a variety of edge-case scenarios, like this:

 

Hey, we should get tickets to go to Alice’s Wonderland Resorts! I’ll go to Step 1.

 

Wait, I should ask the Mad Hatter if he wants to come along with me. I’ll just leave this open in my browser until I find out. More than 30 minutes go by, and my session expires in Google Analytics.

 

OK, now I’m ready to reserve those tickets! I go on to Step 2, but since my session expired, Google Analytics shows me entering the funnel at Step 2.

 

In most cases like these, the bulk of users enter at the first step and a handful at subsequent steps. However, in some scenarios, you might only wish to see users who completed the full process.

 

The first two steps are a sign-up process, giving the users access to a page with some downloadable resources. The final page can be bookmarked and returned to by those users, who do that often (which is why you see so many of them enter at the final step). But the users you’re really interested in are just those who actually signed up in Steps 1 and 2.

 

By setting the Required setting on the first step of the funnel, the funnel reports show you only users who began at Step 1. Note that this affects only the funnel reports; the number of conversions overall for the goal is always determined only by the final destination URL.

 

Modals and iFrames

Google Analytics

modal is a popup that occurs within a page (rather than as a separate tab or window within your browser).

 

This modal popup could contain two different types of information:

Often they use the iframe HTML element to simply include another page within. In other cases, such as a lightbox for images, they might simply show/hide or restyle elements of the page content.

 

To check the content of a particular modal popup on your site, you can simply inspect the source code. If the iframe element is used, there is actually a distinct page for the content of the modal.

 

As long as your Google Tag Manager container is on that page, you’re measuring it just like any other, and a pageview for that URL will appear in Google Analytics, just like all your other pages show up.

 

Note If the page within the iframe is on a different domain, you need to use cross-domain tracking. There are some additional browser and security issues regarding cross-domain iframes; see the Google Analytics developer documentation for details on handling this scenario.

 

For models that do not use an iframe element, you can use the Click trigger to trigger tags. It’s up to you whether you want to trigger a Google Analytics event tag or pageview tag, depending on the nature of the interaction and how you want to be able to see the data in Google Analytics. For an image in a lightbox, an event tag might be most appropriate.

 

If there’s a form or other multi-step process within the modal popup, however, you might want to use a page view so that you can set up a destination goal with a funnel.

 

[Note: You can free download the complete Office 365 and Office 2019 com setup Guide for here]

 

AJAX and Dynamic Processes

Google Analytics

Sometimes a multistep process may occur all within the same page, without the page reloading or the URL changing. The user interacts with the content to step through the process, and the content of the page dynamically changes, but the user is on the same page.

 

It’s even possible for a whole website or web application to be built as a single page, which changes content as the user “navigates” through, though the page never fully reloads or changes URLs.

 

This is commonly referred to as AJAX (short for Asynchronous JavaScript and XML, although the term has come to encompass a variety of related techniques that aren’t necessarily asynchronous and don’t necessarily use XML).

 

AJAX can be an elegant and attractive option for dynamic content, but it also introduces several challenges because of the ways it differs from a “normal” website with distinct pages and URLs.

 

Since the page doesn’t fully refresh, Google Tag Manager only triggers the single, initial page view. To capture further interactions, you’ll have to use other event listeners to trigger tags. There are a couple of possible options, depending on how the site is set up.

 

The History Listener. Most modern AJAX designs are browser- and search engine-friendly: they allow direct linking to dynamic content, and they allow the browser’s back and forward buttons to operate correctly.

 

They do this by several different methods of inserting entries into the browser’s history to keep track of the state and path of the user. GTM’s History Listener can be triggered by these changes.

 

The Click Listener. For simple situations, or where dynamic interactions are not reflected in the browser history, you can use the Click Listener to trigger a click on a particular button, link, or another element.

Both of these are described in the following sections.

 

Caution  If you aren’t the author of the AJAX processes on your website, make sure you speak to the developer and understand how they operate.

 

GTM’s listeners are pretty harmless and unlikely to interfere with the page’s functionality, but you do want to ensure that the data accurately reflects the interactions you want to capture.

 

Flash and Other Browser Plugins

Google Analytics flash

Interactive, dynamic content in a page may also be in an embedded object handled through a browser plugin, such as content developed using Adobe Flash.

 

In the browser’s DOM, such objects are a black box: their content is not accessible via JavaScript, so neither GTM’s built-in listeners nor custom JavaScript can give you detailed information about user interactions with the content of Flash.

 

Instead, tracking can be built into the Flash object itself, using Flash’s scripting language (ActionScript) to interface with the browser’s JavaScript.

 

In the past, Adobe has provided a semiofficial ActionScript library for Flash tracking in Google Analytics, although updates have not occurred in some time, and at the time of this book’s publication, it has not been updated to support GA’s newest Universal Analytics tracking.

 

(Microsoft Silverlight, an alternative to Flash, is in a similar situation, but Microsoft has announced the end of support for Silverlight, so it is unlikely that its Google Analytics tracking library will be updated.)

 

However, ActionScript in a Flash object can call JavaScript within the page containing the object, so you can push events to the data layer for Google Tag Manager from your Flash widget or application. Google Tag Manager can then trigger tags based on the data layer messages.

 

Conversions That Span Sessions

GA’s model of conversions includes a funnel that occurs within a single session. For some more complicated processes, it’s possible that the user might actually complete several steps in one session, and come back at a later time to finish. Here’s one common example of how that might happen in account signup or registration process:

 

  • The user fills out details to create their account, going through one or several pages of forms on the website (Pages A, B, C).
  • An email is sent to the email address the user registered to confirm that it’s correct.
  • The user clicks a link in the email, opening another page on the website, to confirm and finish the account registration (Page D).

 

You could create a single goal with a funnel all the way from Page A to Page D. However, it’s certainly possible that a user completes the steps from Page A through C, and then returns at a later time, in a new session, to Page D (after receiving the email).

 

A better approach might be to have two separate goals, one from Page A to Page C, and another for Page D. 

 

In other scenarios, you might have a long or complicated process in which a user can save their progress and return later. Or, you might be interested in whether the same user comes back twice within a week.

 

In such cases, you might keep track of specific behaviors or achievements with a cookie, and only trigger a pageview for your goal when some cumulative set of achievements is completed.

 

You can set new cookies with custom JavaScript (using the document.cookie property), and GTM’s variable types include the ability to read a value from a cookie.

 

Once you’ve created Google Tag Manager variables based on cookie values you’ve set, you can use them in a trigger or in the URLs of virtual pageviews. 

 

For tracking users across devices, which is very useful in situations where users log in and you want to tie together their behavior, regardless of the device or browser they’re using to access the site.)

 

You can set up goals in Google Analytics to easily allow you to make comparisons on conversion metrics. Goals can be based on URLs, events, or the number of pages or duration of a session. Goals based on destination URLs can include a funnel, which is a series of steps, also specified by URL, that lead up to the final conversion page.

 

For interactions where URLs don’t change, you can still set up URL-based goals using pageviews with virtual URLs. Google Tag Manager includes a Form trigger for form submissions and a History Change trigger for dynamic AJAX-based interactions, as well as the Click trigger discussed previously.

 

You can override the URL recorded by Google Analytics in the tag in Google Tag Manager using variables or text to generate a virtual URL label.

 

Campaign Tracking

Campaign Tracking

For links to your site that you control, you can specify exactly the value you’d like Google Analytics to use for the medium and source (as well as additional traffic source dimensions). This could include many types of marketing and advertising links:

  • Paid search and display advertisements
  • Social posts and paid social advertisements
  • Links in email marketing, such as a newsletter or promotion
  • Links from partner or affiliate sites
  • Links to offline advertising, such as print, TV, or radio

 

Note  Google Analytics can only measure activity on your website and how users arrived there. It’s not a tool for measuring activity on other sites, such as how many people liked or shared a link on a social network. Other tools can be used to gather those types of data.

 

It’s useful to be able to specify your own labels for these types of traffic since you’ll want to break them out from referral, organic, and direct traffic and be able to analyze their effectiveness. You can specify your own values for a variety of traffic source dimensions:

  • Medium: The general category of the type of traffic. Values such as email, social, display, print, and so forth, are common.

 

  • SourceWhere specifically within a medium the traffic came from. Often this is the domain of another website, such as a social network or a site where a display ad was shown. For an email, it might be the name of the list the email was sent to; for print, it might be the name of the publication.

 

  • Campaign: A specific promotion or marketing activity. For example, you might promote the Spring Season Ticket Sale across many mediums and sources. You want to be able to bring all of that traffic together under a single campaign.

 

  • Keyword (optional): A keyword used in search advertising.

 

  • Ad Content (optional): A label describing the content or format of the ad. For example, you might use this to distinguish several different display ads with different creative content or to differentiate between different sizes and formats for the ad.

The Acquisition reports allow you to view traffic using any combination of these dimensions.

 

Campaign Tracking URLs

Campaign Tracking URLs

Shortening Campaign URLs

Campaign URLs can be long, which is fine if you’re using them as the destination URL for an advertisement or in an email. But in a social media post or print, where brevity or readability is important, using a URL shortener can be useful.

 

It’s fine to use a URL shortener (such as bit.ly, the most popular option) with campaign-tagged links from Google Analytics. Simply add the campaign parameters first, then enter the campaign-tagged URL as your link to be shortened.

 

You can also use so-called “vanity URLs” as shortened versions of campaign URLs, by simply using a redirect from a short URL like this:

http://thesisscientist.com/tickets

To a full, campaign-tagged URL: http://thesisscientist.com/?utm_medium=print&utm_source=brochure&utm_campaign=Tickets

Vanity URLs are especially useful for a print or other offline advertisement or marketing material where you’d like to include a branded link.

 

Of course, there’s no guarantee that people who saw the ad will necessarily use the URL (rather than just visiting directly or using a search engine), but it gives you some indication of the relative response of different offline ads used to drive traffic to your website.

 

Avoiding Conflicts with Campaign URLs

Avoiding Conflicts with Campaign URLs

As you saw earlier, you can specify traffic source dimensions by including parameters in the query string in links to your site. In most cases, a website will simply ignore query parameters it doesn’t recognize (such as the utm_ parameters).

 

With some content management systems or web servers, however, unrecognized parameters may cause issues or be disallowed. Specifically, you should ensure that your website is prepared to handle the following query parameters:

  • utm_source, utm_medium, utm_campaign, utm_term, utm_content
  • utm_id
  • gclid

Your website should not cause redirects that strip away these parameters.

 

If for some reason, you need to avoid using query parameters, Google Analytics does provide an alternative. Instead of the URL’s query string, you can use the fragment or anchor string portion of the URL (the portion after the #) to include campaign information.

 

Because this part of the URL is used by the browser and not typically interpreted by the server, it’s “safe” for situations where your web server or content management system prevent you from using Google Analytics’s campaign tracking query parameters in URLs. 

 

The format for the campaign tracking information is the same, but is in the URL fragment (note the #):

  • http://thesisscientist.com/buy-season-tickets/
  • #utm_medium=email
  • &utm_source=Mad%20Hatter%27s%20Club
  • &utm_campaign=Spring%20Season%20Ticket%20Sale

 

To enable this in Google Analytics, there’s a setting called allow Anchor in the tracking code. In the Google Analytics pageview tags in Google Tag Manager, you can set this value in the Fields to Set section when editing the tag. Setting this value to true allows you to use the campaign labels in the URL fragment.

 

Specifying Campaign Values with Google Tag Manager

Specifying Campaign Values with Google Tag Manager

Sometimes rather than specifying campaign values in a link, using the URL parameters described earlier, you’d like to specify campaign parameters based on the page or pages of your website. This is most commonly used for the following:

 

Adapting legacy tracking URLs to Google Analytics: In some cases, you may have a system of labeling campaign URLs that predates your use of Google Analytics.

 

You might use a particular URL pattern or query parameter that you’d like to translate into the appropriate campaign dimensions in Google Analytics.

 

Links “in the wild” with missing or incorrect campaign tagsEven with the best efforts at being assiduous and consistent in applying campaign tracking parameters to URLs, sometimes mistakes happen.

 

You can supply values for campaign dimensions based on a landing page or referrer in such cases. Whatever the reason, you can use Google Tag Manager to override the campaign dimension values.

 

Campaign values in a Google Analytics tag in Google Tag Manager

Let’s look at how to override campaign values in a Google Analytics tag in Google Tag Manager. In Google Tag Manager, in the Tags section, choose a Google Analytics pageview tag and select it to edit.

 

Caution  Typically you would not make this change to the pageview tag on all pages. You’ll probably only want to do this for a particular circumstance defined by a trigger (such as on a particular landing page URL or for a particular referrer) or based on a variable value (such as a query parameter in a URL).

 

  • Click on Configure Tag to make changes to the tag configuration.
  • In More Settings ➤ Fields to Set, enter the following:
  • For the Field Name, choose one of the following options, depending on which field you’d like to set: campaignMedium, campaign source, campaign name, campaign keyword, campaign content, or campaign.
  • For the Value, enter a fixed value or a Google Tag Manager variable with the value you’d like to use.

 

Tip   Variables based on the page or referrer URLs (or portions thereof) are useful for dynamically creating values.

  • Repeat step 3 for each additional campaign value you’d like to set.
  • Select Save Tag to save the changes to the tag.

 

Once published, Google Tag Manager will now override the default traffic source dimension values with the values specified in the tag.

 

AdWords

AdWords

Google Analytics integrates with AdWords, Google’s advertising platform for ads on search results and on its display network. Linking your Google Analytics and AdWords accounts enable a number of features:

 

Auto-tagging of AdWords destination URLs. Rather than having to manually label campaign URLs as described earlier in the blog, AdWords can automatically apply a query parameter (gclid) that identifies the ad. 

 

Google Analytics then imports the traffic source dimension data from AdWords, with Medium CPC, Source Google, and the Campaign, Keyword, and Ad Content corresponding to the campaign, bid keyword, and ad headline in AdWords.

 

Additionally, a number of AdWords-specific dimensions are imported, including Ad Group (to group together ads and keyword within a campaign), Matched Search Query (the query that triggered the ad based on the bidding keyword), Ad Slot, Placement Domain (for display network placements), and others.

 

Importing AdWords metrics into Google Analytics reportsGoogle Analytics includes a section of AdWords reports under Acquisition that import metrics such as Impressions, Clicks, CTR (click-through rate), Cost, and CPC (cost-per-click).

 

Combined with conversion and revenue data in Google Analytics, these can be used to calculate ROAS (return on ad spend) or CPA (cost per acquisition).

 

Having the cost data (from AdWords) and the response data (from Google Analytics) in a single set of reports creates a very valuable tool to evaluate the cost-effectiveness of advertising.

 

Importing Google Analytics metrics into AdWords reportsGoogle Analytics metrics such as Bounce Rate can be used in reporting within AdWords, and Google Analytics goals and e-commerce transactions can be imported to AdWords as conversion data.

 

Creating remarketing audiences in AdWords from Google Analytics segments. All of the behavioral data in Google Analytics can be used to create audiences for remarketing (showing ads to users who have visited the site before or completed a specific action). 

 

Google Analytics’s detailed segmentation tools allow you to tailor specific audience behavior you’d like to target. AdWords audiences can be created in the Admin area in the property settings, or directly from an existing segment in the segmentation drop-down in reports.

 

To Google Analytics in all of these advantages, you need to link your AdWords and Google Analytics accounts together. Linking is between an account in AdWords and a property in Google Analytics.

 

Since there are many possible configurations of sites and how they correspond to Google Analytics properties and AdWords accounts, multiple AdWords accounts can be linked to a single Google Analytics property, and multiple Google Analytics properties can be linked to a single AdWords account, as needed.

 

Tip  Linking an AdWords account to a property will import AdWords metrics (Clicks, Cost, Impressions, etc.) for all of the campaigns in the AdWords account, potentially including campaigns or ad groups that have ads for other sites.

 

It’s a good idea to try to orGoogle Analyticsnize your AdWords and Google Analytics accounts in a similar fashion, with one AdWords account per site (Google Analytics property). Even though it’s not strictly necessary, it makes it easier to understand how advertising and sites match up.

 

DoubleClick Platforms

DoubleClick Platforms

Google Analytics Sessions: Add user to Google Analytics

Google Analytics typically counts users with the client ID, an identifier stored in a cookie that is particular to a specific browser and device. For sites where users log in or you can otherwise identify them, Google Analytics supports using a user ID instead for a more accurate count of users across devices.

 

In Google Tag Manager, the user ID is captured from the website, typically by inserting the user ID value into the data layer. Google Analytics tags in Google Tag Manager are altered to include this user ID variable.

 

Google Analytics reports a metric called Users, which sounds like it counts the number of people using the site. A “user” should represent a single person’s activity over time on the site, right?

 

Unfortunately, it’s a little more complicated than that. Google isn’t watching us all through our device’s cameras and using facial recognition to identify us (yet), and so “user” and “person” are not precisely the same thing.

 

Google Analytics uses a cookie that contains a client ID. This is a randomly generated identifier. Since it’s stored in a cookie, it’s particular to the specific browser and device. By default, this client ID is what Google Analytics uses to calculate the Users metric and user behavior across sessions.

 

So “user” truly corresponds to “browser/device,” rather than “person.” And as you know, people can and do delete their browser’s cookies (manually or using “private” browsing modes), as well as use multiple devices (they’ve visited your website on both their laptop and mobile phone, for example).

All of this means that counting users by client ID is inaccurate to some degree.

 

In some cases, that’s the best you can do, and it’s a limitation of website measurement that you have to live with. Sometimes, however, you have better ways of knowing who a person is when they interact with your site—a site where users log in.

 

Because they log in, you know exactly who they are regardless of what their cookie says or what device they are using.

 

 Google Analytics allows us to set an additional identifier, called the user ID, which can be used to arrive at a better approximation of “users” to “people,” and shows us the activity by the same person across devices and browsers.

 

USER ID TRACKING

One straightforward scenario for user ID tracking is simply to stitch together website sessions by the same user across devices, using a login, as described above. The user ID can also be useful to join up data between:

 

Website activity and mobile apps. If users log in to both your website and mobile apps, you can unify their activity across those interfaces and devices. Website activity and other online or offline marketing activity.

 

If users log in to your website, you may have a profile in your CRM or other systems that include information like an email address, social network usernames, or a loyalty card number (for in-store purchases).

 

Some of this data may be made available in Google Analytics through data import or by using the Measurement Protocol, or you may join up the data after exporting it, using tools such as using BigQuery for data warehousing and analysis or using the Google Analytics APIs to extract data.

 

Depending on the internal data you retain about your customers, you may be able to think of additional ways to use this data.

 

Send User ID Data with Google Tag Manager

Now that you’ve enabled Google Analytics to receive and use user ID data, you need to set up your site and Google Tag Manager to send it.

Provide a User ID Value

 

Your site needs to provide a user ID value for Google Tag Manager to use. The most direct way to do this is to include an entry in the data layer declaration (the information included in the data layer before the Google Tag Manager code):dataLayer = [{ 'userId': 'alice0214' }];

 

Then you can simply use a data layer variable in Google Tag Manager to access this value.

Getting this value in the data layer typically involves some server-side website coding to insert the appropriate value Depending on your site, there may be other possible ways to find the user ID value: in a cookie, or even using an element on the page where it says “Welcome, Alice0214!”.

 

Using a data layer variable ensures that other changes to the site (e.g., changing the layout where the “Welcome, Alice0214!” element is placed on the page) don’t affect your tracking setup.

 

As with many other variables discussed in this book, using the data layer to organize information for Google Tag Manager is always safer and more reliable than relying on page content or other scripts (which are potentially out of your control).

 

DIMENSION OR METRIC?

When you have some piece of data from your website that you’d like to use in Google Analytics, you have to decide: Is this a dimension or a metric?

 

Sometimes, the choice is easy. If the value is text, it is certainly a dimension. Metrics are always numbers. So anything you’d use text for—a category for pages or other hits, a label or identifier for users or sessions—must be a dimension.

 

So, you might wonder, is the inverse true: If it’s a number, it must be a metric? This requires a little more thought. Metrics are always numbers (an integer, currency value, or length of time), but not all numbers have to be metrics.

 

To find examples, look at the list of built-in dimensions in Google Analytics. You’ll find that some of them are numbered: Page Depth (the number of page views that occurred during the session), Day of Week (0 to 6 for Sunday to Saturday), and many others. What’s going on here?

 

In some cases, a number is just a label for something. This is the case in the Day of Week dimension, for example, the numbers 0 to 6 are simply labels for Sunday to Saturday, not measurements of any kind, and it would be nonsense to total them up.

 

In other cases, like Page Depth, those numbers are based on measurements. There are already metrics that measure “how many page views?”—that metric is just Pageviews! Why would you ever need a dimension for this when you already have a metric?

 

To find the reasoning behind this choice, remember that dimensions are used to categorize or bucket together hits, sessions, users, or products.

 

The Page Depth dimension, then, gives you a way to say “Show me metrics for all the sessions that had exactly 1 pageview” (or 2, or 3, etc.). Dimensions are used as the rows of reports, whereas metrics fill out the columns. If you want to be able to see metrics across some list of categories, that category is a dimension.

 

Additionally, remember that metrics get totaled up across hits, sessions, users, and so forth, whereas dimensions are simply labels. 

 

When thinking about the custom dimensions and metrics that you desire for your own site, think about what you’d want the report to look like. The row labels are dimensions; the column values are metrics.

 

Accessing Custom Dimensions and Metrics in Google Analytics

The following sections walk through this process, beginning with a relatively simple example. Suppose users of your site can register for the Alice’s Wonderland Resorts Mad Hatter Club, which signs them up for special offers and discounted park admissions.

 

When they sign up, they specify their preferred park location, which helps you target the offers that you send to them. You want to record this information in Google Analytics.

 

You need to ask yourself several questions before you begin:

Is this a dimension or a metric? This is a dimension, as it’s a label for various categories (park locations for the Mad Hatter Club membership). What’s the scope? 

 

Since the Mad Hatter Club Location applies to the same user every time they return, you’ll want the scope to be used. Google Analytics applies the value to every session in which they return with the same cookie.

 

Where will the data come from? You have to already have this data somewhere! There’s some database or application connected to the website where users sign up for the Mad Hatter club, and when they sign up or log in, you’ll look up that information. 

 

You’ll explore this in more detail shortly, but the answer to this question is always specific to your site’s platform and tools since the data ultimately comes from some existing information.

 

Generating Custom Data

Now that you’ve set up the name of the custom dimension and the scope where you’re going to send the data, you need to tackle the more difficult part: finding the data to send.

 

You need to already be gathering the information that you want to send to Google Analytics, and then make it available in some way.

 

For instance, if you wanted to send in information that describes users’ gender and age, logically you need to first know their gender and age—Google Analytics and Google Tag Manager can’t automatically create this data for you! There are several ways that you can gather such data, but they all fall into two general categories:

 

Surfacing information from an internal database, such as a content management system with information about pages and content, a user database for information about users who log in to the site, or e-commerce system with product data. 

Collecting information from a user, either directly through a form or indirectly through their behavior on the website.

 

Note  In this blog, you are considering how custom dimensions and metrics are filled directly from a website.

 

It’s also possible to fill in values for certain dimensions and metrics (including custom ones) using the data import features of Google Analytics, taking a bulk set of values and associating it with Google Analytics fields.

 

Using existing information in a system connected to the website is the more common option, so let’s consider that situation first. (You can use GTM’s form trigger to capture form field values; more on that in a later example.)

 

Whatever the source of the data, you need to figure out how to get it to the web site's codewhere it can be read by Google Tag Manager. Sometimes it may be readily available on the site.

 

For instance, imagine a blog or news site that would like to pass in content metadata such as publication date, author, or tags with every article. Usually, this information is already present in a content management system and can be inserted into the site’s template.

 

Sometimes this information is a little trickier to retrieve. Maybe you have a user database available with all sorts of information about users when they log in, like the user’s contact information, their Mad Hatter Club status and preferred city, their hat size, and whatever else you know about them.

 

This information is only accessible when a user logs in and you’re able to match them to their personal information.

 

Tip  Consider ways to incentivize users to sign in to your website! This gives more information about the site’s audience and allows passing in custom information more frequently. Additionally, signed-in users enable cross-device tracking if you’ve configured your User ID View correctly

 

If you know the information, then there’s a relatively easy way to pass this information to Google Tag Manager: the data layer. Accessing the value and inserting it into the data layer will be specific to your site’s tools and platforms, of course.

 

Recommend