Tracking first-time users on your site or app - The Signal
Blog Post

Community Tip: Tracking First-time Users

This community tip outlines how to track the first time a user visits your website or app so you can measure your metrics in terms of new versus existing users.

First-Time Users

First-time users are defined as any user who arrives at your website or app for the first time – you have never seen this user before. It is important to know who is a first time user versus a returning user in terms of measuring your metrics How do first-time users convert through sign up? What is first-time versus returning user retention? What traffic source do my first-time users come from? Answering these questions will give you valuable product insight not readily available by looking at all users simultaneously.

By measuring first-time users you can get a granular view into what your users are doing when they have never used your website or app before. You may find user experience insights that you cannot discover without analyzing these users – say for example most of your users do not sign up the first time they visit your site. This may mean your home page is too cluttered or your sign up process is not being emphasized enough, allowing you to make the necessary user interface tweaks to test the new layout for future first-time users.

Tracking First-Time

In order to track a first-time user in Mixpanel, you will need to specify an event and property combination that designates a first time user. In general this would mean you attach a property to an event or set of events when a first-time user performs them. In Mixpanel this can require the usage of super properties, which allow you to assign a property value to a user which sends along with all of the events they perform.

Using an external database

You can track first-time users directly by maintaining a list of all first-time users in a database. The idea would be to maintain a record of each distinct id which accesses your website on a separate database. Then, whenever you encounter a user, you would check if their distinct id exists in the list of users who have already been seen. This would allow you to check if the user is new or returning and assign a property value to their “Home Page” or “App Open” or equivalent event.

var match = "FALSE";
for(var i=0; i<database_length; i++) {
    current_id = database[i];
    if(current_id == distinct_id) {
        match = "TRUE"

match == "FALSE" ? mixpanel.register({"First Time": "TRUE"}) : mixpanel.register({"First Time": "FALSE"});
mixpanel.track("Home Page Viewed");

Using only Mixpanel

Tracking first-time users using only Mixpanel can be done by assigning all new users a super property when they arrive at your site. Instead of checking if a user has or has not been to the site, you would instead assume all users are brand new. Then, when a user arrives, you would assign them a super property value to indicate they are a returning user for future visits. Using this code you can quickly and easily begin tracking any new first-time user.

mixpanel.track("Home Page Viewed");
mixpanel.register({"First Time": "FALSE"});

Using a “first-time” landing page

Instead of setting a property value based on the user’s visit to a general page which every user visits, you could direct new users to a specific page. This works best in apps where you can send a user to, for example, a welcome page. From this page you can then send an event which indicates they are a first-time user. It is recommended you keep this the same event name as your normal first screen event so you can compare the metrics for first-time and recurring users more easily later on.

mixpanel.track("Home Page Viewed", {"First Time": "TRUE"});

Implementing any of the above with a callback

One thing to keep in mind is the above implementations assume you will set a super property after sending an event. In some instances, the time the page takes to load can cause the super property to set before the event is sent, even if it is located later in the code. To remedy this, you will want to register the super property in the callback for the event.

mixpanel.track("Home Page Viewed", {"First Time": "TRUE"}, function() {
    setTimeout(mixpanel.register({"First Time": "FALSE"}), 500);

Measuring First-Time Users

In Funnels, you can view how first-time users convert through a specified set of actions on your site or app. This can be something as simple as signing up all the way to as complicated as making a purchase from San Francisco within 30 days of their first-time event. Being able to sort your first-time users in funnels will allow you to view the distinct conversion rates of first-time users versus returning users. You may find that returning users are more likely to perform certain events than a first-time user – you might want to tweak your site or app design to better highlight this “goal” you want your new customers to complete.

This funnel report shows that return users are more likely to complete the conversion process and sign up than first-time users.

Using Retention you can directly measure how first-time users are retained when compared to returning users. This analysis will allow you to view how new users return to your site to perform a specific event as compared to your already existing users. You can then find out what events drive users back to your website as compared to what events first-time users perform – if these are not in sync, you may want to update your website or app to properly introduce first-time users to the features you want them to be using regularly.

This retention report compares new users against existing ones, showing that first-time users having higher retention rates over the course of 12 days.

Depending on your implementation library and use case, one of the above methods for tracking first-time users may be more applicable to your needs. Feel free to reach out to with questions regarding how you can implement first-time user tracking in your specific Mixpanel implementation.

Get the latest from Mixpanel
This field is required.