Using Offline and Online data to drive Google Analytics Remarketing

The Google Analytics platform has been changing from a web analytics tool to a user-centric digital measurement tool (we’ve been calling it Universal Analytics). This evolution includes a number of changes to the system and completely new features. But what can you do when you put all of these pieces together? I wanted to write […]

Using Offline and Online data to drive Google Analytics Remarketing is a post from: Analytics Talk by Justin Cutroni

The post Using Offline and Online data to drive Google Analytics Remarketing appeared first on Analytics Talk.

The Google Analytics platform has been changing from a web analytics tool to a user-centric digital measurement tool (we’ve been calling it Universal Analytics). This evolution includes a number of changes to the system and completely new features. But what can you do when you put all of these pieces together?

I wanted to write a quick post about how a business could use the entire platform to better market to users on the web based on non-website activities. We’ll explore how to use offline and online data to create remarketing lists in Google Analytics.

Before I start a hat-tip to my buddy Dan Stone – a product manager at Google Analytics who often talks about this type of usage.

Influencing Display Advertising using Email Behavior

Businesses interact with users via many different channels – search, display, social, email, etc. And they’re always looking to better understand how one channel impacts another channel. That’s why we have attribution modeling.

But sometime we want to take direct action, or even automated action, in a channel based on user behavior in a separate channel.

For example, I may want to change my search or display strategy for users on my email list. Perhaps I want them to see different display ads because I have a better relationship with them.

Here’s an example.

With Analytics we can collect data from email marketing tools, send it to Google Analytics and then use that information to change display campaigns.

We can send data from email marketing tools, to Google Analytics, then use the data to drive Remarketing.

We can send data from email marketing tools, to Google Analytics, then use the data to drive Remarketing.

The Implementation

With some of the new features in Google Analytics it is very possible to change a user’s display advertising experience based on behavior in other digital environments.

The first thing we need to do is bind the data in Google Analytics to the data in our own systems. This might be the data in a CRM or some other customer system. We’re going to use an old-school method that I describe in the post integrating Google Analytics with a CRM.

Here’s a summary…

When a user visits your site (or your app) Google Analytics sets a unique, anonymous identifier. This identifier is called the Client ID or cid for short.

What we need to do is extract the client ID value from the Google Analytics cookies and pass it to your CRM system. Once it’s in your systems you should be able to join your internal customer IDs with the GA ID. I should note – this is not some task you finish in an afternoon. You need some nerd help and it could take a while.

You can extract the GA identifier from the tracking cookie and send it to your own system.

You can extract the GA identifier from the tracking cookie and send it to your own system.

Make sure you check out these two posts for more information:
Integrating Google Analytics with a CRM
Understanding Cross Device Measurement and the User-ID

Now that we have the two data sets joined we can do something really cool – we can send user-specific data to Google Analytics from other systems. This means that when we send out an email, or some other user-specific actions happens in our system, we can send that behavioral data to Google Analytics. How?

To send data to GA from other systems we use the measurement protocol. This technology let’s us send data to Google Analytics from any system that can connect to the internet. It defines how to send data to GA. We’ll use the measurement protocol to send data about email activities.

When we send an email to a user we will also send a measurement protocol hit to Google Analytics.

When an email is sent from your system, you can send a hit to Google Analytics using the measurement protocol.

When an email is sent from your system, you can send a hit to Google Analytics using the measurement protocol.

Specifically, we’ll send an event piece of data. The event will indicate that an email was sent to this user and the type of email:

www.google-analytics.com/collect?v=1&tid=UA-XX-Y&cid [UniqueID]&t=event&ec=Email&ea=Send&el=BackToSchool2014

If we want to be really fancy then we can also send a second hit to Google Analytics when the user receives the email and another hit when the user opens the email. For example, if the user opens the email then we can trigger a pixel within the email that sends a hit to Google Analytics.

www.google-analytics.com/collect?v=1&tid=UA-XX-Y&cid=[UniqueID]&t=event&ec=Email&ea=Open&el=BackToSchool2014

I need to stress, you need to write a bunch of code that generates these hits. The implementation will really depend on your systems.

The data in the above hits indicates that this email was part of the BackToSchool2014 campaign (look for the event data ec for Event Category, el for Event Label, ea for Event Actions. If we looked in Google Analytics the data would look something like this:

Offline email actions can be captured with the measurement protocol as events.

Offline email actions can be captured with the measurement protocol as events.

All of these hits include a specific parameter named cid. This is the Client ID for the particular recipient of the email that I discussed earlier. When Google Analytics processes these hits they will be merged with the dame user data from the website – because they have the same cid value.

OK, now we have user data coming from two separate systems and Goole Analytics is merging it together.

Here’s where the fun comes in.

Because all of this data is in one place, we can segment users in Analytics based on behavior, then use that list of users for remarketing.

You can join the Google Analytics ID, called CID, with your own ID. But then you can collect off-site actions in GA and tie them to other GA data.

after all of our work, we’re using the GA data measuring sent emails to create a remarketing list.

For those that have not use Remarketing, this is one of my favorite features in Google Analytics. Remarketing let’s you segment user on your website then send that list of users to Google AdWords (or DoubleClick if you use Analytics Premium) for use as a remarketing list.

The remarketing segment would look like this:

Segmenting users that received and opened an email.

Segmenting users that received and opened an email.

This segment is all users that opened the back-to-school email. I could also add a condition that the user received the email, but that’s not really necessary.

Now we can use this list of users in AdWords. How? I may want to use the same creative for their ads. Or perhaps I offer them the same deal that was in the email.

This technique is not just for email – you can use the measurement protocol to send data from any system. That means behavioral information from other digital experiences can be used to drive remarketing lists.

Hopefully this example gives you some idea of how multiple Google Analytics features can be used together to drive real business results.

Using Offline and Online data to drive Google Analytics Remarketing is a post from: Analytics Talk by Justin Cutroni

The post Using Offline and Online data to drive Google Analytics Remarketing appeared first on Analytics Talk.

Advanced Content Tracking with Universal Analytics

A while ago I wrote Advanced Content Tracking – a post about how to measure if users are actually reading your content. I’ve been getting a lot of requests to update this code for Universal Analytics. So here it is – an updated script specifically for use with Universal Analytics. This Google Analytics customization collects […]

Advanced Content Tracking with Universal Analytics is a post from: Analytics Talk by Justin Cutroni

The post Advanced Content Tracking with Universal Analytics appeared first on Analytics Talk.

A while ago I wrote Advanced Content Tracking – a post about how to measure if users are actually reading your content. I’ve been getting a lot of requests to update this code for Universal Analytics.

So here it is – an updated script specifically for use with Universal Analytics.

This Google Analytics customization collects data as users scroll down a page. It uses events to track when a post loads, when the user scrolls more than 150 pixels, when the user reaches the bottom of the content and when the user reaches the bottom of the page.

This technique uses Google Analytics events to track a user as they scroll down a page of content.

This technique uses Google Analytics events to track a user as they scroll down a page of content.

The end result is some cool data about how many users actually read content. Here’s a sample of what the data looks like. This is just an basic event report with the Event Action and Event Label.

You can access the Reading data in your Event reports. Here we see a single article and how often users scrolled, read the whole article and got to the bottom of the page.

You can access the Reading data in your Event reports. Here we see a single article and how often users scrolled, read the whole article and got to the bottom of the page.

The Scroll Tracking Code

Here is the JavaScript code that measures user scrolling.


TIP – You can use the tabs at the top of the code window to try the script. Just click on Result.

What’s changed in this version?

First, the blog post title is now collected as part of the event. Specifically I’m pulling the page title from the HTML and putting it into the event label. This makes it easier to drill down and see which pages people are reading. This was possible before using the Page Title dimension, but using the event label makes it just a bit easier. See the image above.

Another thing I change is I now use a Custom Dimension rather than a Custom Variable, to collect the ‘reader type’. Custom variables do not exist in Universal Analytics.

This change will impact your data! You will no longer see data in the Custom Variables report – because you’re not using Custom Variables. Custom Dimensions are only available in Custom Reports and Custom Dashboards.

I also changed how the Custom Dimensions are set. This script will set a Custom Dimension when the user reaches the bottom of the post content – not the bottom of the page. When they reach the bottom of the content they are categorized as a scanner or a reader.

  • A scanner is someone that simple scrolls to the bottom of the content in less than 60 seconds.
  • A reader is someone that take more than 60 seconds to reach the bottom of the content.

This is hardly a scientific way to categorize users, but it works for me :)

Finally, I added three custom metrics to store the time metrics: time to scroll, time to content bottom and time to page bottom.

Remember, in order to configure Custom Dimensions and Custom Metric you must first add them via your Google Analytics admin settings.

Other than the above changes the functionality is still the same.

Implementing the code

Step 1: There are a few code changes that you must make in order for this code to work on YOUR site.

1. Turn off debugging: This flag will display alert messages, rather than send GA data, when the user scrolls, reaches the bottom of the content and reaches the bottom of the page. If you do not set this to FALSE your users will get all sorts of alert messages :)

2. Decide how far you want for scroll depth: I send an event after the user scrolls 150 px. You can change this value, but I believe it works fine and does capture user engagement.

3. Specify where the bottom of your content is: This is the most important setting. This script sends an event when the user gets to the bottom of a post. That’s determined by the HTML. For me, the HTML is identified as .entry-content, as shown in this code.

if (bottom >= $('.entry-content').scrollTop() + $('.entry-content').innerHeight() && !endContent) {

You must change this line of code to identify a piece of HTML on your site that signifies the end of the content. This is the hardest part of the implementation.

Step 2: Add the code before the closing on your site. Make sure it appears AFTER the Universal Analytics page tag. It should look something like this when complete:

<head>

... all sorts of tags ...

<script>
  //
  // Universal Analytics page tag
  //
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXXXX-YY');
  ga('send', 'pageview');

  //
  // Scroll tracking script
  //
  jQuery(function($) {
    // Debug flag
    var debugMode = true;

    // Default time delay before checking location
    var callBackTime = 100;

    // # px before tracking a reader
    var readerLocation = 150;

    // Set some flags for tracking & execution
    var timer = 0;
    var scroller = false;
    var endContent = false;
    var didComplete = false;

... More code here ...

</script>

That should be it. You should see data instantly in the Real Time Event reports.

I encourage you to read the instructions in my original post.

Finally, a lot of people have asked me about implementing this script with Google Tag Manager. This really warms my heart :) I love tag management!

You can use this script with Google Tag Manager – but it takes a bit of work. I’ll write a separate post on that topic.

That’s it. I hope you find this script useful. Feel free to modify it to fit your needs. I’ve really enjoyed the data that it generates – it’s helped me better understand my readers and content.

Advanced Content Tracking with Universal Analytics is a post from: Analytics Talk by Justin Cutroni

The post Advanced Content Tracking with Universal Analytics appeared first on Analytics Talk.

How to Use Google Analytics Content Grouping: 4 Business Examples

Content Grouping is a useful feature that let’s you group your website or app content together and view aggregate metrics for each group. This is particularly useful if you have a lot of content to analyze. Rolling up your content, based on your specific business structure, is very helpful when creating dashboards and other custom […]

How to Use Google Analytics Content Grouping: 4 Business Examples is a post from: Analytics Talk by Justin Cutroni

The post How to Use Google Analytics Content Grouping: 4 Business Examples appeared first on Analytics Talk.

Content Grouping is a useful feature that let’s you group your website or app content together and view aggregate metrics for each group. This is particularly useful if you have a lot of content to analyze. Rolling up your content, based on your specific business structure, is very helpful when creating dashboards and other custom reports.

In this post I’ll talk about how to actually use the data and walk through some examples for various business types.

If you have not set up content groupings, please check out my post on how to set up Google Analytics content groupings.

Standard GA Reports

Your content groupings are available in Google Analytics behavior reports. Navigate to the Behavior > Site Content > All Pages report. Notice at the top of the data table there is a selector for the primary dimension. This drop down list all of the content groupings that you added to Google Analytics.

Use the selector to choose a specific content grouping in your Google Analytics Content reports.

Use the selector to choose a specific content grouping in your Google Analytics Content reports.

This selector also exists in the navigation flow, so rather than viewing how users move from page to page, you can view how users move between the different types of content on your site.

You can also use your content groupings in the Navigation Summary report.

You can also use your content groupings in the Navigation Summary report.

Very handy for understanding the behavior of users!

It also exists in many other content reports, like the Landing Pages report and the Site Speed Page Timings report.

But who uses the standard reports these days? :) Analysis driven organisations use Custom Reports and Dashboards. Let’s look at how you can use content groupings in both features.

Custom Reports & Dashboards with Content Groupings

When you create a content grouping, Google Analytics will create a dimension for each content grouping.

Remember, a content grouping contains a number of groups, and each group can contain a number of pages or screens.

Each content grouping contains multiple content groups. A content group contains multiple pieces of content.

Each content grouping contains multiple content groups. A content group contains multiple pieces of content.

This means that the values for the content grouping dimension will be all of the content groups that you created within that grouping.

You can create up to five content groupings in Google Analytics, therefore you could have five new dimensions, one for each content grouping.

Use the content grouping dimensions just like you would any other dimension. Here’s a simple custom report that shows some a potential content grouping for a blog.

You can use your content groupings in a Google Analytics custom report.

You can use your content groupings in a Google Analytics custom report.

Then, when you look at the report, you’ll see something like this:

When you add a content grouping to a Google Analytics custom report, the data will be aggregated based on content group.

When you add a content grouping to a Google Analytics custom report, the data will be aggregated based on content group.

Note: I added this custom report to the Google Analytics solutions gallery. You can add it directly to your account here.

You can also use the content grouping dimension in your dashboards. Here is a very simple example using the page value metric and the content grouping dimension.

You can also use the Content Grouping dimension in a Google Analytics Custom Dashboard.

You can also use the Content Grouping dimension in a Google Analytics Custom Dashboard.

That’s really all there is to using content grouping in Google Analytics custom reports and custom dashboards. No go and give it a try!

One other note – the content grouping dimensions are hit level dimensions. This means that you can only use them with hit level metrics, like pageview, time on page, etc. You can not use them with session level metrics, like conversion rate, or revenue per visit.

Content Grouping Strategies

To really take advantage of content groupings you need to plan your content grouping carefully. You need to understand how your organization wants to analyze this data. So let’s look at a how different types of businesses might use content grouping.

Ecommerce: Patagonia.com

Patagonia sells outdoor equipment for men, women and children. They’re known for their ethos that you should travel “fast and light” when in the outdoors – take only what you need. They’re also known for their environmental advocacy. They incorporate both of these messages into their marketing stories.

Effectively breaking down the content structure could help each department at Patagonia better understand their marketing initiatives and site optimization efforts.

So how might we create a content grouping strategy based on their business?

Google Analytics Content Grouping can be used to organize the content on an ecommerce website.

Google Analytics Content Grouping can be used to organize the content on an ecommerce website.

Product pages: I would start by grouping all product pages together. It’s really important to understand what percentage of your users are making it to product pages. If people don’t look at product pages then they usually can’t buy something. And I’d take it one step further – group product pages by product line. I’d also be sure to differentiate category pages from the generic product pages.

You can mimic your product architecture with your content groupings.

You can mimic your product architecture with your content groupings.

Special selling tools: One cool feature that the Patagonia site has is the ‘kit builder’. This is a tool that let’s a customer build the best clothing combination for different conditions or activities. This is another section that could really use it’s own content group.

Special shopping tools can be categorized in their own group.

Special shopping tools can be categorized in their own group.

Checkout pages: Next I’d group all checkout pages together. These are all the pages in your checkout process. The percentage of people that see checkout pages might be very small, but I like to put these pages in their own group. They’re not product related, and they’re not marketing related. So they need their own group.

Account management pages: Many ecommerce sites let customers manage account settings, check the status of their order, manage returns, etc. I would lump all of these pages together in an Account Management group.

Marketing pages: Now we get into a large chunk of the content – marketing pages. Patagonia has a lot of information about their brand, and initiatives. Rather than lump all of this together as just Marketing pages, I would actually break all of this up into groups based on the different initiatives.

In the case of Patagonia I would use all of these different groups that you can see in the navigation.

Use a Google Analytics Content Grouping to categories marketing pages.

Use a Google Analytics Content Grouping to categories marketing pages.

Support pages: Business is all about relationships – and that’s represented by different types of support content. We can create a support group that containing any materials related to support. Again, you can create sub-groups for different types of support content (product support, order support, etc.)

Error pages: I like to group all error pages into a single group, then I can drill into the group and view the specific errors. This group can contain all different kinds of errors, depending on your personal preference. It could be technical errors, like 404 or 502 errors. Or it could be more functional errors, like when a user adds an incorrect credit card number during their purchase.

Software as a Service: Mailchimp.com

Mailchimp is a popular service that helps businesses manage their email marketing initiatives. Like all SaaS sites it’s primarily divided into two sections: a marketing section and an application section. The content grouping will mimic this general structure of content.

Product marketing pages: If people are going to sign up for the Mailchimp service then they need to know about the features! Product marketing page are pages dedicated to product information, this includes information about price, features, etc.

For a SaaS site, create groups for different kinds of marketing content.

For a SaaS site, create groups for different kinds of marketing content.

In addition to specific product information, there’s also a lot of thought leadership material to help drive marketing.

Marketing content pages: These pages are non-product marketing pages that help you demonstrate your thought leadership. It may be blog pages, or other content. In our example of mailchimp.com, there might be multiple groups. For example, they have a blog, but they also have a ton of research about email marketing. I would put this material in a marketing content group. Or even better, in the Reports group!

I would create a Google Analytics content group for the research reports on the MailChimp site.

I would create a Google Analytics content group for the research reports on the MailChimp site.

Application pages: The other side to a SaaS site is the actual application. This is the section of the site where you log in and actually use the product. Like the marketing pages, there can be many different types of application pages. Let’s go back to our example of Mailchimp.com. I would break down the content based on product features.

Perhaps we could use the application navigation as a template for the content structure.

You can create different groups for each part of the online application.

You can create different groups for each part of the online application.

Account management pages: Here’s another example of grouping different parts of the application together. We could easily group together the pages that control account management. And you can see from the image above that there are sections of the app dedicated to other functionality – all should be grouped accordingly.

Error pages: Like other types of sites it’s a good idea to group all error pages together. See the ecommerce section above for more details. These groups can be both website errors or application errors – like a login error page.

Gaming Application: Clash of Clans

We all use our mobile devices for incredibly important things, like waging medieval warfare on other clans! HA! Anyone out there like Clash of the Clans?

You can categorize app content using Google Analytics Content Groupings.

You can categorize app content using Google Analytics Content Groupings.

In reality, gaming apps are very similar to other business models – like publishing and commerce. Some games generate revenue from in-game ads while others up-sell users on features, like new levels. Some do both. We can group games content together just like we do ecommerce.

Game level screens: Most of the content for a game is probably level based. We can replicate this base structure in Google Analytics. If you’re a fan of Clash of the Clans then you there are other parts to the game in addition to levels. There are attack screens, chat windows, etc. All of these screens can be added to groups to roll-up the data.

Ecommerce screens: These screens are used to sell the user on pay features. In the case of Clash of Clans you can buy more gems, which can then be used to purchase other items, like more armies!

I would put all ecommerce app screens into a separate content group.

I would put all ecommerce app screens into a separate content group.

Configuration screens: Most apps have a configuration section. This is where the user can change everything from the language, to colors, etc.

Error screens: Last but not least we have error screens. Again, these can be technical app errors or functional errors, like login issues.

For Publishers: MarketingLand.com

Let’s face it, content grouping was made for the publishing industry! They’re the ones that have to organize thousands of pages of content. I don’t want to dwell on publishing too much, but let’s take a look at MarketingLand.com, a popular destination for anyone working in the digital marketing world.

I’ve actually written about how to customize google analytics for publishing sites in the posts Custom Variables for Publishers and how to measure how far users scroll down a page. I think both of those techniques still apply.

But now, if you’re a publisher, you can also use content groupings to organize the data about your content. This provides one more way to roll up data for analysis.

Content Category: Almost all publishers group content by category – and now this can be done with the content grouping feature.

Publishers can create content groups based on the organization of their content.

Publishers can create content groups based on the organization of their content.

Some publishing sites organize content in other ways, like by author or publication date. I would suggest creating content groups for topic categorization, and custom dimensions for any secondary organization (author, date, etc.)

Account pages: Some publishers, like the New York Times, offer a premium membership service. This is not the case with MarketingLand.com. But, if it did have a member’s section, you could group all of those pages together.

Error pages: Do I need to go over this again :)

I hope this post provides some inspiration for how you might use Content Grouping for your business. Ultimately how you organize your content groupings will be based on your organization. There is no right or wrong – just use a structure that is useful.

Questions or comment? Leave a note below – and happy grouping!

How to Use Google Analytics Content Grouping: 4 Business Examples is a post from: Analytics Talk by Justin Cutroni

The post How to Use Google Analytics Content Grouping: 4 Business Examples appeared first on Analytics Talk.

How to Set Up Google Analytics Content Grouping

Today everyone is creating content – lots and lots of content. Measuring that content can be a challenge given the sheer volume that’s out there. That’s where Google Analytics Content Grouping can help. This feature let’s you categorize your content based on your own business rules. Then, rather than view your data based on page […]

How to Set Up Google Analytics Content Grouping is a post from: Analytics Talk by Justin Cutroni

The post How to Set Up Google Analytics Content Grouping appeared first on Analytics Talk.

Today everyone is creating content – lots and lots of content. Measuring that content can be a challenge given the sheer volume that’s out there. That’s where Google Analytics Content Grouping can help.

This feature let’s you categorize your content based on your own business rules. Then, rather than view your data based on page URL or screen name, you can view based on your specific groups.

In this post I’m going to talk about how content grouping works and how you set it up.

Key Vocabulary: Groupings and Groups

There is a little terminology we need to cover before we get into the setup: groupings and groups.

You can create multiple content groupings in Google Analytics.

Within a grouping you can create multiple content groups.

A group is a collection of content. It could be pages in a certain section of your website. Or it might be screens from a certain part of your app. It can be just about anything.

A grouping is just a bunch of groups.

Each content grouping contains multiple content groups. A content group contains multiple pieces of content.

Each content grouping contains multiple content groups. A content group contains multiple pieces of content.

You can create multiple content groupings in Google Analytics and switch between them in the reports.

Here’s an example. For my blog I created a grouping called Blog Content Categories.

Within that grouping I create a number of groups to categorize the different types of content on my blog. There’s a group for posts, a group for about me pages, a group for error pages, etc. In the configuration I created a rule that puts each page in a group based on the structure of the URL.

You can view your content data based on groups, rather than URL, screen name or title.

You can view your content data based on groups, rather than URL, screen name or title.

Any item that is not added to a group will appear in the (not set) content group.

It’s important to know that there is not one specific report where you access this data. When you create a grouping it’s literally becomes a new dimension of data. You choose to view that dimension in almost all of the content reports.

Let’s take a look at how you actually create a grouping and groups.

Creating Groupings & Groups

Google Analytics does not automatically create content groupings – you must configure the tool to do that. Navigate to the settings for a specific view and choose Content Groupings.

Content Grouping is a view level setting.

Content Grouping is a view level setting.

Here you will see a list of all your groupings. You can choose to create a new group or edit an existing group.

Here's a list of your Google Analytics content groupings. You can add or edit groupings here.

Here’s a list of your Google Analytics content groupings. You can add or edit groupings here.

There are three methods you can use to create a content group – let’s take a look at each.

Tracking Code Method

This method requires you to add a small piece of code to each page on your site or in your app. The code will literally set the name of the content group when the page or screen renders. Here’s how the code would look for Universal Analytics:

ga('create', 'UA-XXXXXXXX-Y', 'example.com');
ga('set', 'contentGroup5', 'Group Name');
ga('send', 'pageview');

Or, if you’re working in iOS the code might look like this:

id tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-XXXX-Y"];
[tracker set:[GAIFields contentGroupForIndex:5]
value:@"Group Name"];

The code for a content group is similar to the code for a custom dimension. You can set 5 content groups using the tracking code. Each group is associated with a number, one through five, as shown in the example above.

Check the Google Analytics support documentation for more code examples.

Basically this method let’s you suck in the group name, via code, from some other system. It might be a CMS, a data layer, or just the HTML of the page.

The key is that you somehow add the name of the group to the Google Analytics code.

Pros: Using the tracking code method you can use code to automatically adjust to changes in your content and new content groups.

Cons: It requires IT involvement to set up. But once it’s configured very little IT support.

I should also mention that content grouping is coming to Google Tag Manager. This will provide another way to programmatically set the content group – so stay tuned.

Extraction Method

The extraction method extracts (get it) the name of your content groups from an existing dimension of data. The idea is that you use a regular expression to parse the dimension and automatically extract the name of your group.

For example, the name of your content groups might be in the page title, like this:

Your website might use the name of the content in the Page Title or Screen Name dimension.

Your website might use the name of the content in the Page Title or Screen Name dimension.

I would need to specify that my group name is in the Page Title dimension, and then provide a regular expression that extracts the appropriate value.

The content grouping extract method will automatically pull the name for a content group from a dimension of data.

The content grouping extract method will automatically pull the name for a content group from a dimension of data.

For those of you that do not use regular expression, the value in the parenthesis will automatically be extracted. Google Analytics will then use the value as the group name.

You can see that this one rule will work for every product page on my site – as long as they are well formatted.

Pros: No coding involved. Flexible collection.

Cons: You might need to update your regular expressions when you add new content to your site or app. Specifically something that does not match your existing rules. Believe me – updating settings SUCKS. People forget to do it all the time.

In you’re new to regular expressions check out this reg ex tutorial in the Google Analytics help center.

Rules Method

The rules method is almost exactly like the extract method. The ONLY difference is that you have to MANUALLY name the group. The value for the name is not automatically pulled from a dimension of data.

The content grouping extract method will automatically pull the name for a content group from a dimension of data.

The content grouping extract method will automatically pull the name for a content group from a dimension of data.

Like the extract method you can create rules based on different dimensions of data- the page title, page url or the screen name. If the dimension value matches the rule then the content is added to the group.

Pros: No coding. Don’t need to know regular expressions.

Cons: You need to remember to update your rules when you add new content or if your site urls or app screen names change. Again – updating your analytics settings SUCKS. People forget to do it all the time.

Which method should you use?

That’s a tough question. Personally, I think page category is a critical piece of data that should be added to a page data layer. If you take this approach then using the tracking code method is very scalable.

I also like the extract method. It’s very flexible and reliable – as long as you have processes in place to maintain your implementation :)

Important things to know

Ok, so here are a few very important things to know.

You can use all three methods for creating groups within the same content grouping.

The grouping logic is applied to your data sequentially. That means that Google Analytics first applies the tracking code method first. Then it applies the extraction method. And finally it applies the rules method. You can use all three methods for your implementation.

When a page or screen matches a rule it is added to that group.

A page or screen can only be in ONE content group at a time! That means that an page or screen can only belong to one group at a time.

And finally, content groups are NOT applied to historical data. They are only applied from the moment you configure the feature.

A Best Practice

Because Google Analytics applies all grouping methods to your data, it is possible to use a combination of grouping methods.

But, because they they are applied SEQUENTIALLY, it’s a good idea to put your very specific grouping rules first, followed by your general rules. This way the later, general rules will catch anything that slips through the early, specific rules.

Content Group methods are applied sequentially.

All three content grouping methods are applied to each piece of content. They are applied sequentially.

It’s really, really important to try and get your groups right the first time. While you can edit your groups, there is no way to change the data that has already been processed.

Make sure you test your groups first before announcing them to your entire team.

It’s also a good idea to add an annotation to Google Analytics so everyone knows when the data was added.

Ok, I think that’s it for how to implement this feature.

Don’t worry – I’ll explain how to use content groups in a couple of days.

How to Set Up Google Analytics Content Grouping is a post from: Analytics Talk by Justin Cutroni

The post How to Set Up Google Analytics Content Grouping appeared first on Analytics Talk.

Dimension Widening: Import data directly into Google Analytics

There are lots of different ways to put data in Google Analytics. You can collect data from a website with JavaScript. You can collect data from an app using an SDK (Android or iOS). Or you can collect data from any network connected device using the measurement protocol. But there’s another way to add data […]

Dimension Widening: Import data directly into Google Analytics is a post from: Analytics Talk by Justin Cutroni

The post Dimension Widening: Import data directly into Google Analytics appeared first on Analytics Talk.

There are lots of different ways to put data in Google Analytics. You can collect data from a website with JavaScript. You can collect data from an app using an SDK (Android or iOS). Or you can collect data from any network connected device using the measurement protocol.

But there’s another way to add data to Google Analytics – you can import data using a feature called Dimension Widening.

You can add data to Google Analytics a number of ways - including Dimension Widening.

You can add data to Google Analytics a number of ways – including Dimension Widening.

With Dimension widening you can import additional dimensions and metrics directly into Google Analytics via a CSV upload or programmatically import data via an API.

Let’s take a look at how you might use Dimension Widening to augment the data in your account, and ultimately do better analysis.

Why Add More Data?

Analytics is more valuable when you can align the tool more closely with your business strategies and tactics. Adding additional data, like customer history, content publishing information, advertising cost data, etc. can help provide context to your data, thus making it easier to gauge performance and identify opportunities for improvements.

Adding additional data can also streamline your reporting (yes, basic reporting still happens) by consolidating all of your data in a single system that everyone has access to.

That’s where Dimension Widening comes in.

It is a mechanism to move data into Google Analytics.

How Dimension Widening works

You can upload two types of data to Google Analytics: Dimensions and Metrics.

A dimension is an attribute of a user or the sessions she creates.

A metric counts something – like time, money, clicks, etc.

When you use Dimension Widening you are uploading values for one or more dimensions or metrics.

You can upload values for existing dimensions/metrics or you can upload values for new dimensions/metrics that do not exist in Google Analytics.

When Google Analytics process the data it will join your custom data to the the existing data using something called a key.

The key binds your data, the data uploaded in a CSV file or sent programatically, to the Google Analytics data. When Google processes the custom data it will look at the value for the key, and then try to find the same value in the Google Analytics data.

If Google Analytics finds a matching keys then it will take the data in that row of the custom data and pull it into Google Analytics.

The key links your custom data to the data in Google Analytics.

The key links your custom data to the data in Google Analytics.

There are four basic steps to configuring Dimensioning Widening.

1. Identifying the data you want to import.

Step one is really simple, identify the data that you want to add to Google Analytics.

Remember, you can import a value for any dimension or metric that currently exists in Google Analytics. OR you can import values for custom dimensions and custom metrics that are not normally found in GA – more on this below.

When choosing the data you want to import ask yourself this – what data to I need to understand the behavior of my users? How can I make my analytics life easier by consolidating data in Google Analytics?

You also need to define your key. This is obviously critical. If you can’t define a key then you can’t import data.

2. Create the schema in Google Analytics.

Once you define your key and the dimensions/metrics you want to import it’s time to add the schema to Google Analytics. Think of this step as telling Google Analytics how to interpret the CSV file (or data feed) that you will import.

Choose a property in the admin section, then choose Data import and Dimension Widening.

The Dimension Widening settings are in the Data Import section of a property.

The Dimension Widening settings are in the Data Import section of a property.

To begin you need to name the data set you will import. You can actually upload multiple data sets (more on this later), so make sure you name it something very descriptive, like “Campaign Data” or “Content Information”.

Then choose the view where you would like the data applied.

Every data set must have a name, and you must specify which views to apply the data to.

Every data set must have a name, and you must specify which views to apply the data to.

TIP: Dimension widening will permanently change the data in a reporting view! It’s a good idea to test your dimension widening on a TEST view before applying it to your main reporting view.

Now add the schema. First, add the key that you’ve defined for your data.

Next, specify the dimensions and metrics that you want to add.

You must enter a schema into Google Analytics. Add the key along with the dimensions you would like to widen.

You must enter a schema into Google Analytics. Add the key along with the dimensions you would like to widen.

Here’s something cool – as you choose your key and dimensions Google Analytics will automatically show you the column headings that you will need to add to your CSV file.

As you add your schema Google Analytics will provide the column headers for your CSV file.

As you add your schema Google Analytics will provide the column headers for your CSV file.

Notice that they’re not the names that appear in the drop down boxes. They’re the dimension/metric names that are used in the API. Fear not – you don’t need to understand what they mean.

3. Build your CSV file.

Once you finish defining your schema choose save.

You’ll be presented with two options: get more details of your CSV file OR get an API key to upload your data programatically. Let’s focus on the Get Schema option.

Once you define your dimension widening schema you can download a CSV template or get an API key.

Once you define your dimension widening schema you can download a CSV template or get an API key.

Click the Get Schema button.

This window contains some really useful information. First, a list of the column headers that you need to add to your CSV file. This includes your key and all the other dimensions that you are adding to Google Analytics.

There’s also a way to download a CSV template for your specific data. The template is just an Excel file with the headers added to the first row.

Google Analytics will provide the column headers for your CSV and provide a CSV template that you can fill with your data.

Google Analytics will provide the column headers for your CSV and provide a CSV template that you can fill with your data.

4. Upload your CSV file or Send Data via API

Remember, there are two ways to add your data – via an API or manually via a file upload process. Let’s focus on the later – the file upload.

This isn’t too complicated, just click upload :) Once the file is uploaded Google Analytics will widen your data as it is processed.

You can check on the processing of your data using the Refresh button.

You can check on the processing of your data using the Refresh button.

NOTE: when you use Dimension Widening the data you import is NOT applied to historical data. Your data is only applied going forward.

I find that GA can process the file very fast (minutes). You may want to refresh your list often to determine if the new data has been added.

That’s it! That’s the basic process.

But you probably want to use Dimension Widening to import custom data, not data that’s already in Google Analytics. Let’s take a look at how to do that.

How to add Custom Data

You can also add custom dimensions and custom metrics to Google Analytics via dimension widening. The process is almost exactly the same. The only difference is that you must first define your custom dimensions or metrics in the Google Analytics admin section.

To upload a dimension or metric that does not exist in Google Analytics you must first define those custom dimensions or metrics.

To upload a dimension or metric that does not exist in Google Analytics you must first define those custom dimensions or metrics.

There’s not a lot of configuration here. Just give your dimension a name and choose a scope.

NOTE: You can only widen between dimensions and metrics of same scope. For example, you can’t widen from user scope Key to Hit scope dimensions. Check out this (somewhat old) article on Custom Variables to learn more about scope.

That’s it. Now you can choose these custom dimensions (or metrics) when you add your schema for Dimension Widening.

Once you define a custom piece of data it will be available in the Custom Data schema interface.

Once you define a custom piece of data it will be available in the Custom Data schema interface.

Then create your CSV file with the correct headers and upload your data.

Note: Custom Dimension and metrics are only available in Google Analytics customizations – this includes custom reports, custom segments and dashboards. They can also be used in certain analysis tools, like secondary dimensions.

An Example: Uploading simple publisher data

Let’s say I’m a publisher. I want to add the publication year, author for each article. My key to join my data with GA data is the URL of each page. I already defined two custom dimensions, one for page publication year and one for page author.

I’m going to define my data schema in Google Analytics.

Defining a custom data in your dimensions widening schema.

Defining a custom data in your dimensions widening schema.

Now I build my CSV file using the correct headers for my key and dimensions that I would like to widen.

A sample CSV file with custom dimensions.

A sample CSV file with custom dimensions.

Next I upload my file…

And finally, I have data in my custom dimensions. Here I can see the data in a Custom Report.

Custom Dimensions can be used in a Custom Report, Unified segment or other customization features.

Custom Dimensions can be used in a Custom Report, Unified segment or other customization features.

Best Practices for Managing CSV files

You might want to widen your data based on multiple keys. For example, you might want to widen your product data (using the product ID as a key) and your campaign data (using campaign name as a key).

In this case you’ll need to define two different schemas and upload two different CSV files. Make sure you name them something logical!

Another thing to consider is when to update your CSV files.

For example, let’s say that you’re a publisher, and you’re uploading new data about your content. But you’re publishing new content every day. And probably multiple times a day. You would need to upload a new CSV file every time you publish content. This is too manual. In case you probably want to consider a programmatic solution.

Use the CSV file for things that do not change often. Use the API for things that change a lot!

What about JavaScript and real-time collection?

Given my previous example, you may be asking yourself, “can’t I just collect custom data in real-time using JavaScript?”

Absolutely!

You could do something fancy, like add the data to a data layer, then pull it into some custom dimensions. No problem!

The point is that you don’t always have the time or the IT resource to implement the data collection. Even if you use a cool technology like tag management, it may be that the data you want to add comes from an isolated system. And that it would take too much effort to transport the data from it’s home all the way to the web server.

Dimension widening can be seen as a somewhat faster, less IT intensive way of joining your data together.

Things to be aware of…

Ok, a few things that you need to be aware of when using Dimension widening.

1. Your data is NOT applied to historical data. Your data is only applied going forward.

2. You can NOT widen on ALL dimensions. You can NOT widen on the following dimensions:

  • custom variables
  • product dimensions and metrics
  • campaign dimensions
  • time-based dimensions (hour, minute, etc)
  • geo-dimensions (country, city, etc)

3. If you would like to expand your dimensions and populate Custom Dimensions you MUST use Universal Analytics. The reason is that Custom Dimensions only exist in Universal Analytics. They do not exist in the previous version of Google Analytics.

4. You can not change a schema once it has been entered into Google Analytics. You must delete the schema and then define your new schema.

I know some of these caveats may seem limiting, but remember, this is just the initial version. I know the team is working hard to expand the functionality.

Do you think you will use Dimension widening? If so how? Feel free to share your examples below!

Dimension Widening: Import data directly into Google Analytics is a post from: Analytics Talk by Justin Cutroni

The post Dimension Widening: Import data directly into Google Analytics appeared first on Analytics Talk.