Skip to content

Instantly share code, notes, and snippets.

@leomelzer
Last active April 4, 2017 15:53
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 leomelzer/5c15b68c52dc9f3600773b18c4f56b06 to your computer and use it in GitHub Desktop.
Save leomelzer/5c15b68c52dc9f3600773b18c4f56b06 to your computer and use it in GitHub Desktop.
PV/VV: NPS implementation with Wootric

PV/VV: NPS implementation with Wootric

NPS in our App: NPS

Net Promoter or Net Promoter Score (NPS) is a management tool that can be used to gauge the loyalty of a firm's customer relationships. It serves as an alternative to traditional customer satisfaction research and claims to be correlated with revenue growth. NPS has been widely adopted with more than two thirds of Fortune 1000 companies using the metric.

https://en.wikipedia.org/wiki/Net_Promoter

How to get NPS in your (Ember) App

  1. Sign up for Wootric: https://www.wootric.com/pricing (the free plan works for us)
  2. Add code (see above) and adapt for your application
  3. Add wootric.token to your environment.js
  4. Review settings in your Wootric account (e.g. days until survey is shown, % likelihood that survey is shown etc)
  5. Deploy
  6. Get feedback from your users!

References

  1. Wootric Example for Ember: https://github.com/Wootric/spa-examples/tree/master/emberjs/app (our code is adapted from here)
  2. Wootric Docs for SPA: http://docs.wootric.com/javascript/#single-page-app-spa
{{outlet}}
{{!-- concrete implementation of user service not really interesting, could also pass in user-properties directly --}}
{{nps-survey user=user}}
import Ember from 'ember';
import moment from 'moment';
import config from '../config/environment';
export default Ember.Component.extend({
setup: function () {
/* Disable NPS on dev environment, it's annoying. */
if (config.environment === 'development') {
return;
}
/* Can use this for testing */
if (config.environment === 'development') {
window.wootric_survey_immediately = true;
window.wootric_no_surveyed_cookie = true;
}
// let's retrieve the user service instance
let user = this.get('user');
// let's get the promise and set values appropriately
user.fetchUser().then(function (user) {
window.wootricSettings = {
account_token: config.wootric.token,
email: user.user.email,
created_at: moment(user.user.created_on).unix()
};
$.getScript('https://disutgh7q0ncc.cloudfront.net/beacon.js', function () {
WootricSurvey.run(window.wootricSettings);
});
});
}.on('init')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment