In our application we started the tracking for all users (anonymous and logged-in) but after reaching the MTUs limit we decided to only track users that are logged-in.
To achieve this, we remove the script from our index.html and make sure it is only loaded after the user completes the login. So, when it happens, we load the script and call :
mixPanel.identify('1234') //same ID the user has in our application
The problem is that I'm still seeing anonymous people event's on Mixpanel (with random generated distinct ids) in pages that are only available for logged users (URL /my-account, as example).
At the moment I don't know how is it possible, because if the user is in a restricted page it means that he is logged in - and the mixpanel.identify was called before. I wasn't expecting to see any user with a random distinct id anymore.
Can anyone help us, please?
PS: We never call mixPanel.alias because what the user did before the registration/login does not matter to us.