No matter what type of membership site you operate, analytics on what your visitors and members are consuming most can be a huge asset for your marketing and development efforts.

This article will show you how to track custom data like the user’s Membership Level, and other site related information like the post type, post category, and post author. We include two code recipes to track these custom dimensions in Google Analytics using three popular WordPress analytics plugins.

Note: These recipes are written for Google’s Universal Analytics and have not been updated to provide support for GA4. It is possible the same recipes work for both setups, but they have not been officially approved for us with GA4.

Once configured, you will be able to create a custom report in Universal Analytics (UA) to show top Content for non-members and for specific membership levels.

Putting Google Analytics to work for your Membership Site

Configure a New Custom Dimension/Definition in Google Analytics

Custom dimensions and custom metrics are like default dimensions and metrics in your Analytics account, except you create them yourself. You can use them to collect and analyze data that Analytics doesn’t automatically track.

—via Custom Dimensions & Metrics at Google

Custom Dimensions must be configured for the desired website property in your Analytics dashboard. To track Membership Level as a Custom Dimension, you will need to do the following:

Google Universal Analytics (UA): How to Set Up Custom Dimensions

  1. Log in to your Google Analytics Dashboard.
  2. Select the property that is using Universal Analytics (UA) you would like to manage.
  3. Navigate to the “Admin” management screen and select “Custom Definitions” then “Custom Dimensions” under the “Property” column (middle).
  4. Click “+ New Custom Dimension”.
  5. Name your dimension “membership_level”, and set the “Scope” to “Hit”.
  6. Save Settings.
Create a New Google Analytics Universal Analytics Custom Dimension for Membership Level

After the dimension has been created, take note of the “Index” (a numerical value that you will need for the later steps in this guide.

Screenshot of the Google Analytics Universal Analytics Custom Dimensions List with New Membership Site Data

PMPro now offers a complete Google Analytics Integration plugin with custom membership data and full ecommerce tracking. Say goodbye to Monster Insights or Google Site Kit. This Add On is your all-in-one solution for Google Analytics integration.

Send Custom Dimensions to Google Universal Analytics (UA)

Option 1: Using GA Google Analytics by Jeff Starr

This popular WordPress plugin offers a very lightweight approach to adding the Google Analytics tracking code. Installation and setup instructions for this plugin are available in the repository listing here.

Once you have set up the plugin and created a custom dimension for Membership Level in your Analytics property, you must add the following code recipe to your site. This recipe uses the gap_custom_code filter hook to configure a new tracked dimension for “membership level” with the Index “4”. Your index may be different depending on how the dimension was set up in the web property. You will need to update line 23 of the recipe with your dimension’s appropriate index (i.e. dimension1).

Option 2: Using Google Analytics Dashboard for WP by ExactMetrics

Formerly known as GADWP, this WordPress plugin adds the Google Analytics tracking code and allows you to view key stats right in your site’s dashboard. The plugin offers additional features to customize tracking for your site’s needs, which is what this demo is all about. Installation and setup instructions for this plugin are available in the repository listing here.

Once you have setup the plugin and created the Custom Dimension in your Analytics property, you must add the following code recipe to your site. This recipe uses the exactmetrics_frontend_tracking_options_analytics_before_scripts filter hook to configure a new tracked dimension with the Index “1”. Your index may be different depending on how the dimension was set up in the web property. You will need to update line 16 of the recipe with your dimension’s appropriate index (i.e. dimension3).

Option 3: Using MonsterInsights Pro and the MonsterInsights – Dimensions Addon

When writing these tutorials, I always try to make the customization possible without the need for a premium plugin. If you are already using MonsterInsights or need any of the added features of this premium system, this second method is for you. You can explore current features and pricing of MonsterInsights at their site to help you decide if this plugin is a better fit than the option above.

As in option 1, you will need to configure the MonsterInsights plugin, create the Custom Dimension in your Analytics property, and also install and activate their Custom Dimensions Addon.

The following code recipe will add a new “Membership Level” dimension in the settings page of the MonsterInsights Pro plugin. Once the recipe has been added to your site using a plugin for PMPro Customizations, do the following:

  1. Navigate to “Insights” > “Settings” > “Conversions” > “Custom Dimensions”.
  2. Click “+ Add new custom dimension”.
  3. Select “Membership Level” from the dropdown.
  4. Enter the correct “Index” as it was configured within your web property in Google Analytics.
  5. Save Changes.
Configure Membership Level as a Custom Dimension in MonsterInsights

Adding the Recipe to Your Website

You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.

How to Set Up Saved Reports in UA

Now that have set up your Custom Dimension tracking, you can head over to your Analytics dashboard and create some saved reports to make it easy to access this data.

For my membership site, Paid Memberships Pro, I am primarily tracking the top content accessed by “Non-Members” (dimension value no_level) as well as a separate report of the top content accessed by members of our free level (dimension value 7 which is the Level ID of our Free membership).

These are the two reports that tell me the top post I can work on to increase conversion rates as well as the most popular members-only posts that free or non-members would like to have access to.

Here’s what I did once the dimension tracking was in place and I confirmed it was all set up properly:

  1. Log in to your Google Analytics Dashboard.
  2. Select the property you would like to manage.
  3. In the sidebar, select “Behavior” > “Site Content” > “All Pages”.
  4. In the filter and search area below the graph, there is a link to perform an “advanced” search. Click the work “advanced”.
  5. Select “include”, Custom Dimension: “membership_level”, “Exactly matching” the ID of your membership level OR the exact string no_level.
  6. This will generate a custom report for the selected level/non-members.
  7. Click “Save” in the upper right chart area to save this custom view for easy access.
membership_level filtered report in Google Analytics Page Content area

Saved reports can be accessed at a later time via the sidebar “Customization” > “Saved Reports” screen.

You can add additional saved reports for as many custom searches as you would like. Here are the four custom reports I have set up for our site:

Saved reports in Google Analytics

Putting Google Analytics To Work For You

I hope you’ve enjoyed (and have been able to follow along with) this somewhat advanced tutorial. Google Analytics is a powerful but complex tool—and with the changes coming to Google Analytics 4 it can be hard to stay up to date with everything you need to do.

Whether you have a highly active membership site or are just getting started, it is very smart to get this tracking in place from the beginning. The data will only start tracking conversions from the point of set up and on, it can’t update existing data. The sooner you start this process, the more rich your data will be.

Free Course: Membership Site Development—The Basics

Develop a deeper understanding of membership site development in this beginner-level course. Learn how to make your site work better, save yourself time and money, and improve your site's performance.

Featured Image for Membership Site Development Course: The Basics
Was this article helpful?
YesNo