File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -25,20 +25,19 @@ const user = new MPID();
25
25
26
26
//set current user cookie if it does not exist in cookies;
27
27
if ( user . checkDocumentCookie ( document ) ) {
28
- console . log ( "Reactime user cookie defined. Check dId " ) ;
29
- if ( user . distinct_id ) {
30
- try {
31
- user . setCookie ( ) ;
32
- } catch ( e ) {
33
- mixpanel . track ( `Cannot set user cookie ${ e } ` ) ;
34
- }
35
- } else {
36
-
37
- }
28
+ console . log ( "Reactime cookie found " ) ;
29
+ user . getCookie ( ) ;
30
+ mixpanel . people . increment ( user . get_dId ( ) , "times" ) ;
31
+ } else {
32
+ console . log ( "No reactime cookie found. Attempting set cookie." ) ;
33
+ this . setCookie ( ) ;
34
+ mixpanel . people . set ( user . get_dId ( ) , { "times" : 1 } ) ;
38
35
}
39
36
37
+
38
+
40
39
function mpClickTrack ( e ) {
41
- mixpanel . track ( { event : "click" , properties : { "$ distinct_id" : user . distinct_id } } ) ;
40
+ mixpanel . track ( "click" , { distinct_id : user . distinct_id , where : e ?. target ?. innerText } ) ;
42
41
} ;
43
42
44
43
document . addEventListener ( "click" , mpClickTrack ) ;
You can’t perform that action at this time.
0 commit comments