Calculate DAU and MAU
One way to evaluate your app’s “stickiness” is to compare its daily active users (DAU) and monthly active users (MAU).
The ratio of DAU/MAU represents your average daily active user count / monthly active user count. The closer your ratio is to 1, the more often users are using your app, rather than logging in only sporadically.
This article demonstrates the following:
How to build custom actor properties for daily active users and monthly active users.
How to analyze the actor properties in Explore.
This article uses the Scuba loopback usage data set.
Build the custom actor properties
To analyze DAU/MAU, create two custom actor properties:
One that measures daily activity
One that measure monthly activity
Define daily activity and monthly activity using the same criteria except for the trailing time window.
You can create an actor property in one of two ways:
To create an actor property that you want to save, reuse, and potentially share with other users, follow all of the instructions below.
To create an actor property that you can use only with a single top-level query, define the property in the query palette (see Create a property in Explore with the query palette) when you define the top-level query. You will still follow steps 4-9 below.
To build a Daily Activity actor property, do the following:
In the left menu bar, click Data, then click the Actor Properties tab.
In the top right corner of the window, click +New Actor Property.
At the top of the page, enter a name for the property. We named our property queries_per_user_t1d (instead of something like Daily Activity) to help someone looking at this query later quickly see what criteria we are using to measure daily activity (see step 7).
In the left definition pane, select an actor (or use the default). In our example, we selected username.
Accept the default method, Show, and the default aggregation, count of events.
At Filtered to, click all events. From the dropdown, select the event property or combination of event properties that define a user action. In our example we selected action. The surrounding text automatically updates to say "Filtered to events with action that matches ..."
In the new dropdown, select the actions you want to filter to, adding additional actions with the plus sign. Select the filtered to actions for the property. Click the plus sign to choose multiple actions. For our example, we chose only one action, query request.
For our usage loopback table data, we consider a user to be “active” if they run at least one query. This is why we filter our actor property to event_name matches query request. Choose activities appropriate for your dataset.Click + time options and accept the default of “Trailing window: trailing 1 day”. See Specify time in a query for more information about trailing windows.
Click Go to see your actor property results, then click Save.
To build a Monthly Activity actor property, do the following:
At the top of the daily activity actor property data model page, click the duplicate icon. This creates a copy of the daily activity actor property definition and is especially helpful if you have defined activity using complicated criteria.
At the top of the page, enter a name for the property. We named our property queries_per_user_t28d (instead of something like Monthly Activity) to help someone looking at this query later quickly see the criteria (queries per user) and time range (28 days) we're using to define monthly activity.
If you duplicated the daily activity actor property, you can accept the settings at Method, Show, and Filtered to. These correspond to steps 4-7 above.
Click + time options.
Next to Trailing, click 1 day to open the dropdown. Type
28
and select 28 days. See Specify time in a query for more information about trailing windows. In our example we use 28 days instead of 1 month, because 28 days has a consistent number of weekend and weekday days, regardless of starting date.Click Go to see your monthly activity actor property results, then click Save.
Construct the top-level query
To compare DAU and MAU, build a query in Explore. For example, your end goal might be something like this:
To create a query with DAU and MAU on the same chart:
Navigate to the daily activity actor property (called queries_per_user_t1d in our example).
From the daily activity actor property, click Explore at the top left.
Click measure 1 and edit the name to DAU.
Under Filtered to, click all username actors (or whatever your actor field is named) and select your daily activity actor property from the dropdown. For our example (where our daily activity property is named queries_per_user_t1d), the text automatically updates to read Filtered to username actors with queries_per_user_t1d that is greater than 0. Change the minimum criteria to suit your analysis needs.
Click +measure to start creating the MAU definition.
Click measure 2 and edit the name to MAU.
Repeat the selections from the DAU measure above, substituting your monthly activity actor property in place of your daily activity actor property. In our example, our monthly activity actor property is called queries_per_user_t28d.
Optional: To calculate DAU/MAU:
Click +measure to add a measure 3. Name it
DAU/MAU
.Click count and type an equals sign.
Click a left bracket [ to see a list of the measures defined above.
Enter DAU and MAU separated by a slash. See Calculate measures and filters for information about building expressions.
Click Go to run the query.
Click Pin at the top right to pin the query to a board for future use.