don't identify mixpanel users if public_id is null
This commit is contained in:
@@ -15,6 +15,8 @@ if (mailpoet_analytics_enabled) {
|
||||
|
||||
mixpanel.register({'Platform': 'Plugin'});
|
||||
|
||||
console.log(window.mailpoet_analytics_public_id);
|
||||
if(typeof window.mailpoet_analytics_public_id === 'string' && window.mailpoet_analytics_public_id.length > 0) {
|
||||
if(window.mailpoet_analytics_new_public_id === true) {
|
||||
mixpanel.alias(window.mailpoet_analytics_public_id);
|
||||
} else {
|
||||
@@ -24,5 +26,6 @@ if (mailpoet_analytics_enabled) {
|
||||
if (mailpoet_analytics_data != null) {
|
||||
mixpanel.people.set(mailpoet_analytics_data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ class Analytics {
|
||||
|
||||
/** @return string */
|
||||
function getPublicId() {
|
||||
$public_id = Setting::getValue('public_id');
|
||||
$public_id = Setting::getValue('public_id', '');
|
||||
// if we didn't get the user public_id from the shop yet : we create one based on mixpanel distinct_id
|
||||
if(empty($public_id) && !empty($_COOKIE['mixpanel_distinct_id'])) {
|
||||
// the public id has to be diffent that mixpanel_distinct_id in order to be used on different browser
|
||||
|
Reference in New Issue
Block a user