How to perform behavioral cohort analysis with Google Analytics

If you run a company or a website, cohort analysis is a great way to understand engagement and retention of your users. For example, how many of your users who signed up in June went back to your site in July? The chart below, for example, shows that 33.36% of all users who signed up on Month 0, came back to the site on Month 1. Google Analytics recently added cohort analysis to the set of metrics that they offer to their users, so that you can generate retention curves like the one below on the fly. It is still in Beta, but it allows you to understand user retention over time, especially if you use Google Analytics with User ID view, that is: you track data of signed up users with accounts.


However, not all users are the same. When they first sign up to your site, new users may actually behave in different ways. Their behavior determines whether they will stick to your site or not. A more advanced version of cohort analysis is behavioral cohort analysis. The famous example of this is Facebook's realization, based on user research, that: if a new user adds 7 friends in the first 10 days of using Facebook, they will become an engaged user. Why is this type of analysis important? If you want to maximize engagement and retention, knowing what features / behaviors will make users stick can inform tremendously product building. In the case of Facebook, they changed their onboarding process to incentivize new users to add 7 friends in the first 10 days.

There are a number of companies that give you metrics based on user behavior (Amplitude, for example). They offer advanced analytics that let you study user behavior in detail. However, if you want to start doing basic behavioral cohorts (for free!) you can use Google Analytics to obtain some good results. Here's how:

1. As a first step, you need to let Google Analytics track some events that are meaningful to you. For example, you may want to track, similar to Facebook, friend invites. You need to add Event tracking code to your site in order to let Google Analytics know every time an event is triggered (the code will ping Google Analytics every time an action is taken, e.g. a new user invites a friend).

2. If you have set up event tracking correctly, you can now navigate to your Events Overview in Google Analytics (Behavior > Events) and you shall see all your events. You can group events in categories if you like. You now have to define Advanced Segments to group the users who take certain actions (e.g. "invite a friend") into a separate user segment. Go back to the Cohort Analysis page, and click on Add Segment and then New Segment (red button)