Learn business growth with Google Analytics 4 Forums Google Analytics 4 Implementing GA4 Tracking for Customer Segments and Activity

  • Implementing GA4 Tracking for Customer Segments and Activity

    Posted by Lucas on 20 June 2023 at 4:57 am

    So, on our website, we’ve got these customer groups that we assign each customer to. Depending on their group, they can access different stuff. Now, what we’re wondering is how we can keep track of all the activity and money coming from each group using Google Analytics 4. Any ideas on how we would do that?

    Do we need to set up Content Groups or should we maybe use User-ID’s, using a data layer to hand over the userId along with the customerGroup?

    window.dataLayer = window.dataLayer || [];
      'event' : 'login',
      'userId' : '[userId]',
      'customerGroup' : '[customerGroup]'
    Michael replied 11 months, 1 week ago 3 Members · 2 Replies
  • 2 Replies
  • Carter

    4 July 2023 at 9:35 pm

    Yep! It’s actually pretty straightforward if you’re already sending the data to the data layer. You just need to create a data layer variable with the name ‘customerGroup’ and it will get passed to GTM, easy peasy.

    Just keep in mind, if you are setting up a custom push, it needs to happen after the GTM snippet is loaded. Otherwise, there might not be a data layer to push to or it might get overwritten once GTM loads.

    Also, when you’re working with the user or event where you need the data, remember to pass the variable in a parameter within the tag and then set up the custom dimension on the GA4 side. A little heads up though, the parameter might not show up in GA4 until a day later or whenever it next refreshes. So, it might be a little while before you can create it. But don’t worry, it’s all part of the process!

  • Michael

    9 July 2023 at 3:51 am

    In Google Analytics 4, you should be able to track activity and money from each group without setting up Content Groups. Instead, you can indeed use User-ID’s and a data layer to hand over the userId along with the customerGroup. Your proposal to use window.dataLayer.push is on point and would enable you to track these data effectively.

    Each time a user logs in, a ‘login’ event is sent to GA4 along with userId and customerGroup-values attached to it. After setting this up, you should be able to see these values in your GA4 interface and create audiences, reports, and analysis based on these user properties. Remember to configure User-ID tracking in the property settings of your GA4 property too. For even more detailed tracking, you may also consider utilizing event parameters for specific actions users take. With this information, you’ll be able to assess which groups are performing best and contributing the most revenue.

Log in to reply.