PluginProbe
Parse.ly / 3.3.2
Parse.ly v3.3.2
3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 3.20.2 3.20.3 All 105 releases
wp-parsely / src / js / lib / personalization.js

personalization.js in Parse.ly 3.3.2, at src/js/lib/personalization.js

31 lines 561 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * External dependencies
3 */
4 import Cookies from 'js-cookie';
5
6 const VISITOR_COOKIE_KEY_NAME = '_parsely_visitor';
7
8 export function getVisitorCookieRaw() {
9 return Cookies.get( VISITOR_COOKIE_KEY_NAME );
10 }
11
12 export function getVisitorCookie() {
13 const cookieVal = getVisitorCookieRaw();
14
15 if ( ! cookieVal ) {
16 return undefined;
17 }
18
19 const unescapedCookieVal = unescape( cookieVal );
20
21 try {
22 return JSON.parse( unescapedCookieVal );
23 } catch ( e ) {
24 return undefined;
25 }
26 }
27
28 export function getUuidFromVisitorCookie() {
29 return getVisitorCookie()?.id;
30 }
31