File tree Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import {
13
13
import { useStoreContext } from '../store' ;
14
14
import MPID from "../user_id/user_id" ;
15
15
16
- const cookie = require ( "cookie" ) ;
17
16
const mixpanel = require ( "mixpanel" ) . init ( "12fa2800ccbf44a5c36c37bc9776e4c0" , {
18
17
debug : true ,
19
18
protocol : "https"
@@ -77,8 +76,9 @@ function MainContainer(): any {
77
76
* get set cookies for mixpanel analytics
78
77
**/
79
78
useEffect ( ( ) => {
80
- //console.log("MP ", Object.keys(mixpanel));
81
- //attempt to read cookies
79
+ /**
80
+ * create new user and attempt to read cookies
81
+ */
82
82
const user = new MPID ( ) ;
83
83
/**
84
84
* If developing turn tracking off by setting user.debug to true;
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ class MPID{
9
9
}
10
10
11
11
setCookie ( ) {
12
- console . log ( " Set Cookie " ) ;
13
12
//create a string of random data
14
13
this . cookie = cookie . serialize ( "reactime" , crypto . randomBytes ( 64 ) . toString ( 'hex' ) ) ;
15
14
this . distinct_id = this . cookie ?. reactime ?. slice ( 0 , 20 ) ;
@@ -22,9 +21,7 @@ class MPID{
22
21
23
22
}
24
23
25
- getCookie ( ) {
26
- console . log ( " get Cookie" ) ;
27
-
24
+ getCookie ( ) {
28
25
if ( this . cookie ) {
29
26
return this . cookie ;
30
27
} else {
@@ -34,19 +31,14 @@ class MPID{
34
31
}
35
32
36
33
checkDocumentCookie ( doc ) {
37
- console . log ( " Check Document Cookie " , cookie . parse ( doc . cookie ) ) ;
38
34
let parsedCookie = cookie . parse ( doc . cookie ) ;
39
35
40
36
if ( parsedCookie ?. reactime ) {
41
- console . log ( "reactime cookie found" ) ;
42
- this . cookie = parsedCookie ?. reactime ;
43
-
44
- if ( ! this . distinct_id ) {
45
- console . log ( " set dId" ) ;
37
+ this . cookie = parsedCookie ?. reactime ;
38
+ if ( ! this . distinct_id ) {
46
39
this . distinct_id = parsedCookie ?. reactime ?. slice ( 0 , 20 ) ;
47
40
}
48
- } else {
49
- console . log ( "No reactime cookie found. Attempting setCookie" ) ;
41
+ } else {
50
42
this . setCookie ( ) ;
51
43
return false ;
52
44
}
You can’t perform that action at this time.
0 commit comments