Initialize NPS poll only once
[MAILPOET-1688]
This commit is contained in:
@@ -25,26 +25,10 @@ function displayPoll() {
|
|||||||
&& window.satismeter
|
&& window.satismeter
|
||||||
&& window.mailpoet_installed_at_isoFormat
|
&& window.mailpoet_installed_at_isoFormat
|
||||||
) {
|
) {
|
||||||
// New users poll
|
const newUsersPollId = '6L479eVPXk7pBn6S';
|
||||||
|
const oldUsersPollId = 'k0aJAsQAWI2ERyGv';
|
||||||
window.satismeter({
|
window.satismeter({
|
||||||
writeKey: '6L479eVPXk7pBn6S',
|
writeKey: window.mailpoet_is_new_user ? newUsersPollId : oldUsersPollId,
|
||||||
userId: window.mailpoet_current_wp_user.ID + window.mailpoet_site_url,
|
|
||||||
traits: {
|
|
||||||
name: window.mailpoet_current_wp_user.user_nicename,
|
|
||||||
email: window.mailpoet_current_wp_user.user_email,
|
|
||||||
createdAt: window.mailpoet_installed_at_isoFormat,
|
|
||||||
},
|
|
||||||
events: {
|
|
||||||
submit: (response) => {
|
|
||||||
if (response.rating >= 9 && response.completed) {
|
|
||||||
showReviewRequestModal();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
// Old users poll
|
|
||||||
window.satismeter({
|
|
||||||
writeKey: 'k0aJAsQAWI2ERyGv',
|
|
||||||
userId: window.mailpoet_current_wp_user.ID + window.mailpoet_site_url,
|
userId: window.mailpoet_current_wp_user.ID + window.mailpoet_site_url,
|
||||||
traits: {
|
traits: {
|
||||||
name: window.mailpoet_current_wp_user.user_nicename,
|
name: window.mailpoet_current_wp_user.user_nicename,
|
||||||
|
Reference in New Issue
Block a user