Integrate with Google Analytics

You can integrate Google Analytics conversion tracking with Memberful. When someone signs up for a new membership on your website, we send an Ecommerce transaction to Google Analytics.

In this help doc:

Find your tracking ID

You'll need to find your tracking ID for the next steps.

If you use Universal Analytics, that's your property ID, and it looks like UA-XXXXXX-N.

If you're using the new Google Analytics 4, that's the measurement ID of a Web data stream, and it looks like G-XXXXXXXXXX. Learn more about GA4 and data streams..

Once you've found your tracking ID, keep it handy, as you'll use it in the following steps.

Enable Ecommerce

If you're using Universal Analytics, toggle on Enable Ecommerce in your Ecommerce Settings.

Ecommerce settings

Set up the WordPress plugin

  1. Install and activate the GA Google Analytics plugin on your WordPress site.
  2. Visit Settings → Google Analytics → Plugin Settings.
  3. Enter your Google Analytics Tracking ID.
  4. Choose Global Site Tag if you're using Google Analytics 4 or Universal Analytics if you're using the older version.

    If you chose Global Site Tag above, allow cross-domain auto-linking by adding the following code snippet to the Custom Tracker Objects field:

      {
        "linker": {
          "domains": ["memberful.com"]
        }
      }
    

    But if you use Universal Analytics, allow cross-domain auto-linking by adding the following code snippet to the Custom GA Code field:

      // Auto link Memberful links
      ga('require', 'linker');
      ga('linker:autoLink', ['memberful.com'], true);
    
  5. Click Save changes. After 24-48 hours, you can log into your Google Analytics account to view your stats.

The last step is to activate Memberful's Google Analytics integration.

Set up the manual integration

For non-WordPress sites, you’ll need to enable Google Analytics to track users when they click a Memberful link on your site. Choose the instructions that match how you include Google Analytics on your site.

With analytics.js (Universal Analytics only)

If you use analytics.js and Universal Analytics, update the code on your site to include the linker configuration:

Replace UA-XXXX-Y with your tracking ID from earlier.

  <script>
    (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-XXXX-Y', 'auto');
    ga('send', 'pageview');

    // Auto link Memberful links
    ga('require', 'linker');
    ga('linker:autoLink', ['memberful.com'], true);
  </script>

For more details, refer to the Google Analytics documentation.

The last step is to activate Memberful's Google Analytics integration.

With Google Tag Manager

If you include Google Analytics on your site using Google Tag Manager, enable cross-domain tracking in Tag Manager.

In step 3, enter memberful.com in the Auto Link Domains field.

The last step is to activate Memberful's Google Analytics integration.

With gtag.js

If you send events to Google Analytics using gtag.js, include the linker parameter when you configure your property.

Replace GA_TRACKING_ID with your tracking ID from earlier.

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'GA_TRACKING_ID', {
    'linker': {
      'domains': ['memberful.com']
    }
  });
</script>

For more details, refer to the gtag.js documentation.

The last step is to activate Memberful's Google Analytics integration.

Test Google Analytics

After you’ve enabled cross-domain measurement using one of the above methods, right-click the Memberful link on your site and select Open Link in New Tab. You should see a linker parameter in the address bar that looks like this:

_ga=1.199239214.1624002396.1440697407

Configure Memberful checkout

Navigate to Settings → Third-Party Services from your Memberful dashboard, and activate the Google Analytics integration. You'll need to input the tracking ID you got earlier.

You're done! Once you connect to Stripe, and leave test mode, Memberful will track all new purchases in Google Analytics.

Keep in mind that certain privacy-focused browsers (like Safari and Firefox) block Google Analytics events, and some members may use ad-blocker plugins.

Track Google Ads

Once setup you can measure which orders (and the value of those orders) are attributable to your Google Ads. Google Ads is another sales channel that will show up in Google Analytics. After setting up your Google Ad campaign, the Google Ads data is typically pulled right into Google Analytics.

If you want to attribute order amount to those Google Ads, you'll need to make sure the GA-Memberful integration is configured and will also need to enable Enhanced Ecommerce reporting in Google Analytics.

Can't find what you're looking for? We'd love to help! 💪

Send us a message through the orange chat bubble in the lower right corner of the page. You'll hear back within a few hours Monday - Friday. 😀