mixpanel


Identify Mixpanel user actions that occured before login


I’m having an issue with Mixpanel identification. I want to be able to track events logged before the user logs in and identify them as such.
Here’s an exemple. Louie opens the webpage and visits the “About” page. Using mixpanel.track('Visit About'), I’m able to log Louie’s anonymous visit. All is fine and dandy.
Louie decides to log in, and a mixpanel.identify(user.id) call identifies him — and subsequent events can be tracked back to Louie. However, the first event (“Visit About”) still shows up with a random, Mixpanel-set distinct ID and hasn’t been associated with Louie.
Is this behaviour expected? What can I do? Cheers
You want alias.
From their Javascript API reference:
Use alias() when a unique ID is first assigned (registration), and use identify() to identify the user with that unique ID on an ongoing basis (e.g., each time a user logs in after registering). Do not call identify() at the same time as alias().
From your description, it sounds like, rather than viewing the "About" page anonymously and then logging in, Louie is viewing the "About" page anonymously and then signing up.
In that case, call alias when Louie signs up, and call identify when he logs in after that. That should associate the random, anonymous Mixpanel ID with Louie's new registered user ID.
Note: using this method will mean that, because Louie triggered an event anonymously and then logged in, Louie's anonymous id for that event will not be linked to his distinct id from logging in. If he had signed up after triggering the anonymous event, you would call alias, and they would be linked. This is a known limitation of Mixpanel, unfortunately. From their documentation:
This is the first time he's accessed your site from this device, so we assign a brand new distinct_id to him. He clicks around and then logs in. You should not call mixpanel.alias() in this situation - we haven't seen him on this device, but he is not a new user. ... Instead of calling mixpanel.alias() you should just call mixpanel.identify(). This will remap his phone activity to the original ID he used when signing up for your service, which is the most desirable outcome. This does mean that regrettably the events he fired before logging in will not be associated with him.
More about aliasing in Mixpanel here.

Related Links

How to export people profiles from Mixpanel and import them back?
mixpanel: alias not working with python
Pulling multiple events in mixpanel raw data api
How to retrieve AB-test data/tweaks from Mixpanel?
How to prevent Mixpanel funnel flow?
Mixpanel cookie not being set
Identify Mixpanel user actions that occured before login
Mixpanel Android - consecutive timeEvent requests scenario
Mixpanel: event color in activity feed
how to see value of distinct_id in Mixpanel
Is there a wildcard character for the Mixpanel API “export” method “event” parameter?
how to do mixpanel.people.increment in Segment
how to get total number of mixpanel events via API
creating a profile with mixpanel to track users not working
How to deal with users who signed up before Mixpanel alias was set up?
Mixpanel — delete user with all past data

Categories

HOME
hpoo
amazon-web-services
python-2.7
windows-8.1
kendo-dropdown
postgresql-9.4
key
code-formatting
plpgsql
out-of-memory
autocomplete
dronekit-python
tibco
repair
haxe
gprs
cdi
mailing-list
port
csrf
chromecast
synthesis
heap-dump
web-deployment
string-formatting
environment
morris.js
webviewclient
history.js
oracleforms
fatfs
splunk-query
xenapp
vcenter
john-the-ripper
lxml
image-optimization
devtools
orchardcms-1.8
nppexec
bluemixtools
telephonymanager
latexml
axis
cloudwatch
rm
deployd
sony-future-lab-n
scala-breeze
visual-format-language
extjs4.1
freshdesk
emacs25
http4s
petsc
metabase
mathjs
wininet
ftp-client
qtcpsocket
swiffy
gulp-uglify
bayesglm
variable-length-array
360-degrees
karma-coverage
azure-xplat-cli
rebar
libgcc
squeezebox
two.js
pageviews
jack
proxy-server
armv6
smips
illuminate-container
colon
acitree
statechart
reentrancy
itunes-sdk
contextswitchdeadlock
gprof
email-verification
clrprofiler
trialware
quartz-core
mongrel2
bass
outlook-2007-addin
asdoc
database-cloning
iphone-sdk-3.1.3
account-management

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App