Solved

Setting up my firt events to collect userID on mixpanel

  • 3 September 2020
  • 14 replies
  • 180 views

Badge

 

Hello the community ! :)

I 'am tryinig to set up a litte workshop for beginners students on mixpanel in france (work as instructor in business school on marketing).

I d like to set an event that will capture the identity id  of a user from collection of his email when sending the form.

<script type="text/javascript">
    mixpanel.identify("{{email input}}");
mixpanel.people.set ({
"#email":"{{email input}}"
});
</script>
 
 
Any tips or ressources appreciated  !
icon

Best answer by robin 14 September 2020, 22:16

Sorry guys, I’ll pass in french, it will be easier.

Bonjour @largeron ,

Aliais n’est plus nécessaire depuis la dernière release de merge-id. 

Le tracking de l’utilisateur est moins compliqué que vous ne le pensez. 

Commencez par faire un tracking .track() avant l’identify puis utilisez identify(email) pour identifier les événements faits avant et après par ce même utilisateur. A partir de là, toutes actions faites par ce même utilisateur sera affiché dans son profile explore. Les fonctions people.set() ne sont prisent en compte qu’à partir du identify.

 

Lorsque vous êtes en mode test, videz toujours vos cookies et localStorage. Utiliser des identify avec des id différent sur le même navigateur pour engendrer des incohérence de tracking. Il est aussi possible d’utiliser mixpanel.reset() pour vider le cache mixpanel.

View original

14 replies

Badge

I have not worked in Javascript, but I think the special email property should be “$email”, not “#email”?

Badge

ok Jaya, thnaks for your comment   l’ll check that right away ! thanks 

Badge

No way, thanks anyway !

Userlevel 2
Badge +1

Hello @largeron ,

First, $email is better than #email because it is a standard field on mixpanel.

Could you send a screenshot of your explore page? The profiles should be there.

Badge

Hi Robin,

ok thanks for this advise again ! i changed it for : "$email":"{{email input}}"

here the screenshot of explore : https://prnt.sc/ues7tm 

 

 

 

Userlevel 2
Badge +1

Hello @largeron,

I think that you sent a first identify() with the ID 144… and that your current people shown on the screenshot is not the one who get the people.set.

I would start from scratch in chrome private mode to reset your cookies and check on explore if your new profile is created.

Badge

Hi Robin, thanks again for your feedback , very helpful
I realize that vendredi@gmail.com data is sent to mixpanel : https://prnt.sc/ufcv64
Now i d like this @email the distinctId  be persistent through sessions.
Mean that when a new visit or session occured , the user to be recognized as vendredi@gmail.com and not as a new undefined one . Thus to be able to get a activity feed populated with insight and not as such : https://prnt.sc/ufczi7
Is that possible ? 
Thanks

Userlevel 2
Badge +1

Hey @largeron ,

Yes this is absolutely possible and already the case. Once you define an identify(), information about the current user is stored inside cookies. You can see them under mp_xxxx. Value can be decoded with https://www.urldecoder.org/

For each new actions sent by this user in the same browser, events will be attributed to this user. 

If the user would then switch to mobile, give his email and navigate on your app, actions would be also attributed to the same user. 

Badge

Hi Robin, 

Thanks again :) ,

1/ you say it’s already the case, but it’s not as it shows here : https://prnt.sc/ufcv64 where under the same session , i mean during 1 visit, it’s “undefined” and if you look at the user record  https://prnt.sc/ufczi7 , not history  is recorded which gather all the behaviour of the user.mixpanel, no activity feed at all ! Again i made a try now, my visit is logged with “distinct Id “ undefined

2/ Sorry but how do i use https://www.urldecoder.org/ ? 

 

Thanks again Robin

Badge

Hi  again the community and @robin 

I”ve read this https://help.mixpanel.com/hc/en-us/articles/115004495783-Assigning-Your-Own-Unique-IDs-to-Users and this  https://help.mixpanel.com/hc/en-us/articles/360039133851#enable-id-merge

I understand that i ‘ve  to assign a super property to the user with this email, with an alias if necessary to unify the collection of user information when user  come and go visiting the website. 

do i have to add a new snippet of code ? or to add another kind  of tracking JS ?
Thanks again

Userlevel 2
Badge +1

Sorry guys, I’ll pass in french, it will be easier.

Bonjour @largeron ,

Aliais n’est plus nécessaire depuis la dernière release de merge-id. 

Le tracking de l’utilisateur est moins compliqué que vous ne le pensez. 

Commencez par faire un tracking .track() avant l’identify puis utilisez identify(email) pour identifier les événements faits avant et après par ce même utilisateur. A partir de là, toutes actions faites par ce même utilisateur sera affiché dans son profile explore. Les fonctions people.set() ne sont prisent en compte qu’à partir du identify.

 

Lorsque vous êtes en mode test, videz toujours vos cookies et localStorage. Utiliser des identify avec des id différent sur le même navigateur pour engendrer des incohérence de tracking. Il est aussi possible d’utiliser mixpanel.reset() pour vider le cache mixpanel.

Badge

Bonjour Robin

Merci beaucoup @robin Robin pour ces explications sur le contexte.

Maintenant reste à traduire cela dans le code !

Userlevel 5
Badge +3

@largeron & @robin — have either of you seen the group Mixpanel en Français :) 

Badge

Hi Cherise

@largeron & @robin — have either of you seen the group Mixpanel en Français :) 

Yes, i usually post in english, also  i didn’t know before posting that Robin was fluent in french ! D be good idea posting to both groups 

Reply