Automating NPS with the promoter.io API
Every Tuesday morning I send out an NPS survey to our previous weeks customers using promoter.io. Usually, this means creating a promoter.io campaign and uploading a csv of all of your customer emails.
Recently promoter.io built a REST API, which mean't made sending out your NPS surveys a piece of cake.
To work with the API I built a thin Ruby wrapper to make my life a little easier. Here's how we use it:
Install the gem by including it in your Gemfile:
Create an initializer to setup the promoter api key.
(Log into promoter.io and click API in the menu to find your API key.)
Make sure you have created a campaign in promoter (with a template that you're happy with), and made a note of its ID.
To find out your campaign id, create a campaign in promoter.io and check out the url. It should looks something like:
https://app.promoter.io/org/111/campaign/222The campaign id is the number at the end (after /campaign). At Lexoo we just use the same promoter.io campaign over and over - just adding to it each week.
You also need to create a contact list for this campaign. Any contact you add to this contact list will work with this campaign. (Make sure it's the contact list that you've created for the campaign you want to upload to.)
Then, I have a simple script that iterates over all of our customers for the previous week - and adds them to the contact list using the
After we've added all that weeks customers, I launch the campaign with the
Promoter::Campaign.send_surveys method - and watch the surveys go out!
Note: by setting the second parameter as false, it won't send out the surveys to anyone who's already received one.
Rather than manually doing this on a weekly basis, I have a cron job set this off for me every Wednesday:
And boom - there we have it, automated NPS requests!
You can view all of the source code here: https://github.com/thechrisoshow/promoter