mixpanel.register() & mixpanel.people.set() for AB-test tracking

  • 9 June 2022
  • 0 replies


I’m new to Mixpanel,  so sorry if the answer to my question is obvious.

I’m running an AB-test and I’m trying to assign a generic property to all my mixpanel events and users. That event is supposed to identify which variant of the AB-test related user/event belongs to. 

Each page on my website return this javascript snippet:

<script type="text/javascript">
            mixpanel.people.set({ AB_TEST_NAME: 0 });
            mixpanel.register({ AB_TEST_NAME: 0 });

Where “0” is a variant in an AB test. It’s determined by the server and with 50% chance it might be “0” or “1”.

I’ve been collecting the data for 2-3 days and if I open any Mixpanel report,  let’s say I just plot the amount of  “SessionStart” events, when I choose “AB_TEST_NAME” as a breakdown I see 3 groups of values instead of 2.


Out of 1000 events:

“0” group contains around 100;

“1”  - also around 100;

“undefined” - around 800 events;


I’m wandering what am I doing wrong? Each pageview should assigns the values for “AB_TEST_NAME” property with the code snippet. Why the majority of events do not have any value assigned?


Thanks for help.

0 replies

Be the first to reply!