Skip to content

Instantly share code, notes, and snippets.

@marinhero
Last active March 29, 2019 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marinhero/b609dd8c2f22701a39b6abec30bac858 to your computer and use it in GitHub Desktop.
Save marinhero/b609dd8c2f22701a39b6abec30bac858 to your computer and use it in GitHub Desktop.
//Test flags. Remove before going live!
wootric_survey_immediately = true;
wootric_no_surveyed_cookie = true;
//This is an example of a user object. You'll have to adjust the example to your own user object or data.
var current_user = {
user_email: 'marin@woot.com',
dashboard_language: 'EN',
registration_date: 1496880000
};
var spanish_messages = {
followup_question: 'gracias por su respuesta',
followup_questions_list: {
detractor_question: 'lamentamos que la experiencia no sea de su agrado. qué sucedió?',
passive_question: 'puede explicarnos sus motivos?',
promoter_question: 'gracias! platícanos, cómo te fue?'
},
placeholder_text: 'detalles de su experiencia',
placeholder_texts_list: {
detractor_text: 'dinos cómo podemos mejorar',
passive_text: 'qué pasó?',
promoter_text: 'platícanos!'
}
};
var english_messages = {
followup_question: 'Thank you for your answer!',
followup_questions_list: {
detractor_question: 'We are sorry about the bad experience',
passive_question: 'How can we do better?',
promoter_question: 'We are happy if you are happy. Please, tell us about it'
},
placeholder_text: 'details of your experience',
placeholder_texts_list: {
detractor_text: 'We are trully sorry, would you mind elaborating?',
passive_text: 'What happened?',
promoter_text: 'Great! tell us about it!'
}
};
wootricSettings = {
account_token: 'NPS-8296bf77',
created_at: current_user.registration_date,
email: current_user.user_email,
language: current_user.dashboard_language
};
// if language is spanish set the follow up to spanish
if (current_user.dashboard_language === 'ES') {
customMessages = spanish_messages;
wootricSettings.product_name = 'nuestra tienda en linea';
wootricSettings.wootric_recommend_target = 'a tus amigos';
} else {
//otherwise default to english
customMessages = english_messages;
wootricSettings.product_name = 'our online shop';
wootricSettings.wootric_recommend_target = 'to your friends';
}
window.wootric('run');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment