add did_hashed to segment identify
This commit is contained in:
@@ -50,11 +50,13 @@ export function useAnalytics() {
|
|||||||
export function init(store: RootStoreModel) {
|
export function init(store: RootStoreModel) {
|
||||||
store.onSessionLoaded(() => {
|
store.onSessionLoaded(() => {
|
||||||
const sess = store.session.currentSession
|
const sess = store.session.currentSession
|
||||||
if (sess) {
|
if (sess && sess.did) {
|
||||||
if (sess.email) {
|
if (sess.email) {
|
||||||
store.log.debug('Ping w/hash')
|
|
||||||
const email_hashed = sha256(sess.email)
|
const email_hashed = sha256(sess.email)
|
||||||
|
const did_hashed = sha256(sess.did)
|
||||||
segmentClient.identify(email_hashed, {email_hashed})
|
segmentClient.identify(email_hashed, {email_hashed})
|
||||||
|
segmentClient.identify(did_hashed, {did_hashed})
|
||||||
|
store.log.debug('Ping w/hash')
|
||||||
} else {
|
} else {
|
||||||
store.log.debug('Ping w/o hash')
|
store.log.debug('Ping w/o hash')
|
||||||
segmentClient.identify()
|
segmentClient.identify()
|
||||||
|
|||||||
@@ -45,11 +45,13 @@ export function useAnalytics() {
|
|||||||
export function init(store: RootStoreModel) {
|
export function init(store: RootStoreModel) {
|
||||||
store.onSessionLoaded(() => {
|
store.onSessionLoaded(() => {
|
||||||
const sess = store.session.currentSession
|
const sess = store.session.currentSession
|
||||||
if (sess) {
|
if (sess && sess.did) {
|
||||||
if (sess.email) {
|
if (sess.email) {
|
||||||
store.log.debug('Ping w/hash')
|
|
||||||
const email_hashed = sha256(sess.email)
|
const email_hashed = sha256(sess.email)
|
||||||
|
const did_hashed = sha256(sess.did)
|
||||||
segmentClient.identify(email_hashed, {email_hashed})
|
segmentClient.identify(email_hashed, {email_hashed})
|
||||||
|
segmentClient.identify(did_hashed, {did_hashed})
|
||||||
|
store.log.debug('Ping w/hash')
|
||||||
} else {
|
} else {
|
||||||
store.log.debug('Ping w/o hash')
|
store.log.debug('Ping w/o hash')
|
||||||
segmentClient.identify()
|
segmentClient.identify()
|
||||||
|
|||||||
Reference in New Issue
Block a user