Skip to content

Commit 673494b

Browse files
author
Jack Crish
committed
investigate d_ids further
1 parent e3aa7e0 commit 673494b

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/app/containers/MainContainer.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,19 @@ const user = new MPID();
2525

2626
//set current user cookie if it does not exist in cookies;
2727
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 });
3835
}
3936

37+
38+
4039
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 } );
4241
};
4342

4443
document.addEventListener("click", mpClickTrack);

0 commit comments

Comments
 (0)