Search code examples
mixpaneluser-tracking

MixPanel user tracking


I would like to track users with MixPanel. I'm using the following code (data is hard-coded, as it is in proof-of-concept state currently):

    if ("@Auth.UserID" !== "0") {
        if ("@SessionWrapper.UserInitialized" === "False") {
            mixpanel.people.identify("@Auth.UserID");
            mixpanel.people.set({
                "$email": "@Auth.UserEmail",    // only special properties need the $
                "$created": "@SessionWrapper.UserCreated",
                "$name": "@Auth.FullName"
            });
        }
    }

mixpanel is initialized, UserID is logged on the console, but I think this is not working. What am I doing wrong and how can I test this feature on mixpanel.com? I've clicked on the streams tab on the left and the Users tab is chosen in the panel.

Am I using the set function correctly? Am I viewing the stream correctly? Thanks.

EDIT: I am using mixpanel-2.1.min.js


Solution

  • So actually people data is not shown in streams, so I wouldn't worry that you are not seeing it there.

    Try checking the explore tab in the people analytics section to see if the new record has been created.