NAV
Objective-C Swift 2 Swift 3

Installing iOS SDK

Using Cocoapods

// Install Cocoapods 
$ gem install cocoapods

//Inside your Podfile
target 'YourProject' do
  pod 'WootricSDK'
end

// Install pods
$ pod install

1. Install CocoaPods

If you don’t have Cocoapods already, you can install it by typing $ gem install cocoapods in your terminal

2. Podfile

Create a Podfile and add pod 'WootricSDK'. This will download and install the latest version of the SDK. If you want to you can specify which version of the SDK by doing something like this pod 'WootricSDK', '0.5.6'. For more information about creating this file, please refer to Cocoapod’s Podfile Guide.

3. Install WootricSDK

On your terminal, and inside your project’s directory, run $ pod install. Cocoapods will download all dependencies specified in your Podfile. From now on, you should use the .xcworkspace file instead of the .xcodeproject file.

Carthage

1. Install Carthage

If you haven’t already, install the latest version of Carthage.

2. Cartfile

Add github "Wootric/WootricSDK-iOS" to your Cartfile, and follow the Carthage installation instructions.

3. Update SDK

In the future, to update to the latest version of the SDK, run carthage update --platform ios.

Dynamic Framework

Note: This is only compatible with iOS 8 and above.

1. Download SDK

Head to our GitHub releases page and download and unzip WootricSDK.framework

2. Add the framework to your project

Drag WootricSDK.framework to the “Embedded Binaries” section of your Xcode project’s “General” settings. Make sure to select “Copy items if needed”

Xcode

Presenting the survey

Step 1. Initialize Wootric

#import <WootricSDK/WootricSDK.h>

// Inside your method
[Wootric configureWithClientID:<YOUR_CLIENT_ID> clientSecret:<YOUR_CLIENT_SECRET> accountToken:<YOUR_ACCOUNT_TOKEN>];

// TODO: The current logged in user's email address.
[Wootric setEndUserEmail:@"nps@example.com"];
// TODO: The current logged in user's sign-up date as a Unix timestamp.
[Wootric setEndUserCreatedAt:@1234567890];

// Use only for testing
[Wootric forceSurvey:YES];

[Wootric showSurveyInViewController:<YOUR_VIEW_CONTROLLER>];
// Inside your method
Wootric.configureWithClientID(<YOUR_CLIENT_ID>, clientSecret: <YOUR_CLIENT_SECRET>, accountToken: <YOUR_ACCOUNT_TOKEN>)

// TODO: The current logged in user's email address.
Wootric.setEndUserEmail("nps@example.com")
// TODO: The current logged in user's sign-up date as a Unix timestamp.
Wootric.setEndUserCreatedAt(1234567890)

// Use only for testing
Wootric.forceSurvey(true)

Wootric.showSurveyInViewController(<YOUR_VIEW_CONTROLLER>)
// Inside your method
Wootric.configure(withClientID: <YOUR_CLIENT_ID>, clientSecret:<YOUR_CLIENT_SECRET>,, accountToken:<YOUR_ACCOUNT_TOKEN>)

// TODO: The current logged in user's email address.
Wootric.setEndUserEmail("nps@example.com")
// TODO: The current logged in user's sign-up date as a Unix timestamp.
Wootric.setEndUserCreatedAt(1234567890)

// Use only for testing
Wootric.forceSurvey(true)

Wootric.showSurvey(in: <YOUR_VIEW_CONTROLLER>)

First import the SDK into your ViewController of choosing. Then configure the SDK with your client ID, secret and account token.

Sign in at wootric.com if you haven’t already. If you just signed up on the Wootric homepage, you will be taken directly to an installation page. If you’re a returning visitor, click on the “Settings" button near the top right of the page. Navigate to the Wootric Installation Guide and you will see a unique account_token for you to use.

The client_id and client_secret can be found on your account’s settings API section.

To display the survey just use showSurveyInViewController. If the user is eligible (this check is built in the method) the SDK will show the survey.

Step 2. Customize the Survey

Comment out the line [Wootric forceSurvey:YES] or Wootric.forceSurvey(true) when you are ready for production. Alternatively, leave the line in the code for testing purposes or to survey the customer upon every visit to a view.

#import <WootricSDK/WootricSDK.h>

[Wootric configureWithClientID:@"your_client_id" clientSecret:@"your_client_secret" accountToken:@"NPS­-xxxxxxxx"];
[Wootric setEndUserEmail:@"nps@example.com"];
[Wootric setEndUserCreatedAt:@1234567890];

// Use only for testing
[Wootric forceSurvey:YES];

// Customization
[Wootric setCustomProductName:@"Wootric"];
[Wootric setCustomFinalThankYou:@"Merci!"];
[Wootric setCustomLanguage:@"fr"];

[Wootric showSurveyInViewController:self];
Wootric.configureWithClientID("your_client_id", clientSecret: "your_client_secret", accountToken: "NPS­-xxxxxxxx")
Wootric.setEndUserEmail("nps@example.com")
Wootric.setEndUserCreatedAt(1234567890)

// Use only for testing
Wootric.forceSurvey(true)

// Customization
Wootric.setCustomProductName("Wootric")
Wootric.setCustomFinalThankYou("Merci!")
Wootric.setCustomLanguage("fr")

Wootric.showSurveyInViewController(self)
Wootric.configure(withClientID:"your_client_id", clientSecret: "your_client_secret", accountToken: "NPS­-xxxxxxxx")
Wootric.setEndUserEmail("nps@example.com")
Wootric.setEndUserCreatedAt(1234567890)

// Use only for testing
Wootric.forceSurvey(true)

// Customization
Wootric.setCustomProductName("Wootric")
Wootric.setCustomFinalThankYou("Merci!")
Wootric.setCustomLanguage("fr")

Wootric.showSurvey(in: self)

This is an important step! Customize your survey with the name of your product or company. As needed, make changes to our trusted survey and sampling defaults. This values can modified from your app.

Wootric Wootric

Step 3. View your Responses Live!

That’s it! Once the WootricSDK is installed, eligible users will immediately start being surveyed. Depending on the traffic of your app, you could start to see responses within a few minutes. Responses will come in to your Wootric dash in real time.

No data yet?

Checkout the Demo dashboard with dummy data.

Wootric

I’d like to do some testing first. How do I ensure that the survey shows up on demand?

You can easily install Wootric in your development environment for testing. The SDK is already set up to show the survey immediately for testing purposes only.

Additional notes on WootricSDK placement:

For apps with registered users:

If your app has registered users, we recommend that you show the survey only on views that your logged in users will access to allow unique user identification.

For ecommerce apps:

If your app has a checkout flow, we recommend that you show the survey on views that won’t interrupt checkout. The most commonly used location is the transaction completion page.

SDK Reference

setEndUserEmail

[Wootric setEndUserEmail:<END_USER_EMAIL>];
Wootric.setEndUserEmail(<END_USER_EMAIL>)
Wootric.setEndUserEmail(<END_USER_EMAIL>)

While end user email is not required it is HIGHLY recommended to set it if possible.

setEndUserExternalId

[Wootric setEndUserExternalId:<END_USER_EXTERNAL_ID>];
Wootric.setEndUserExternalId(<END_USER_EXTERNAL_ID>)
Wootric.setEndUserExternalId(<END_USER_EXTERNAL_ID>)

Set an external ID for the end user. This value is optional.

forceSurvey

[Wootric forceSurvey:<BOOL>];
Wootric.forceSurvey(<BOOL>)
Wootric.forceSurvey(<BOOL>)

If forceSurvey is set to true, the survey is displayed skipping eligibility check AND even if user was already surveyed. This is for test purposes only as it will display the survey every time and for every user.

surveyImmediately

[Wootric surveyImmediately:<BOOL>];
Wootric.surveyImmediately(<BOOL>)
Wootric.surveyImmediately(<BOOL>)

If surveyImmediately is set to true and user wasn’t surveyed yet - eligibility check will return true and survey will be displayed.

setEndUserCreatedAt

[Wootric setEndUserCreatedAt:<UNIX Timestamp>];
Wootric.setEndUserCreatedAt(<UNIX Timestamp>)
Wootric.setEndUserCreatedAt(<UNIX Timestamp>)

When creating a new end user for survey, it will set the external creation date (so for example, date, when end user was created in your iOS application). This value is also used in eligibility check, to determine if end user should be surveyed.

setFirstSurveyAfter

[Wootric setFirstSurveyAfter:<NUMBER_OF_DAYS>];
Wootric.setFirstSurveyAfter(<NUMBER_OF_DAYS>)
Wootric.setFirstSurveyAfter(<NUMBER_OF_DAYS>)

If not set, defaults to value from admin panel. Used to check if end user was created/last seen earlier than ago and therefore if survey is required.

setEndUserProperties

[Wootric setEndUserProperties:<NSDICTIONARY>];
Wootric.setEndUserProperties(<NSDICTIONARY>)
Wootric.setEndUserProperties(<NSDICTIONARY>)

End user properties can be provided as an NSDictionary object.

setProductNameForEndUser

[Wootric setProductNameForEndUser:<PRODUCT_NAME>];
Wootric.setProductNameForEndUser(<PRODUCT_NAME>)
Wootric.setProductNameForEndUser(<PRODUCT_NAME>)

Directly adds a product name to end user’s properties.

setSurveyedDefault

[Wootric setSurveyedDefault:<BOOL>];
Wootric.setSurveyedDefault(<BOOL>)
Wootric.setSurveyedDefault(<BOOL>)

Right after a vote or dismiss we are setting a NSUserDefault that lasts for 90 days and indicates that end user was already surveyed on this device. We are doing this to lower the requests amount to our eligibility server. If your survey throttle is different than 90 days and/or you don’t want to set the surveyed “cookie” you can set this option to NO.

passScoreAndTextToURL

[Wootric passScoreAndTextToURL:<BOOL>];
Wootric.passScoreAndTextToURL(<BOOL>)
Wootric.passScoreAndText(toURL: true)

If you enable this setting, score and feedback text will be added as wootric_score and wootric_text params to the “thank you” URL you have provided. (Check “Custom Thank You” section)

skipFeedbackScreenForPromoter

[Wootric skipFeedbackScreenForPromoter:<BOOL>];
Wootric.skipFeedbackScreenForPromoter(<BOOL>)
Wootric.skipFeedbackScreen(forPromoter: true)

With this option enabled, promoters (score 9-10) will be taken directly to third (social share) screen, skipping the second (feedback) one.

Per view configuration

While Wootric is using values you have set in admin panel, it is possible to override these values directly in code.

setCustomNPSQuestion

[Wootric setCustomNPSQuestion:<NPS_QUESTION>];
Wootric.setCustomNPSQuestion(<NPS_QUESTION>)
Wootric.setCustomNPSQuestion(<NPS_QUESTION>)

Changes NPS Question from admin panel to provided value (English default is “How likely are you to recommend this product or service to a friend or co-worker?”).

setCustomFinalThankYou

[Wootric setCustomFinalThankYou:<FINAL_THANK_YOU>];
Wootric.setCustomFinalThankYou(<FINAL_THANK_YOU>)
Wootric.setCustomFinalThankYou(<FINAL_THANK_YOU>)

Changes final thank you from admin panel to provided value (English default is “Thank you for your response, and your feedback!).

setCustomValueForResurveyThrottle:visitorPercentage:registeredPercentage:dailyResponseCap:

// You can pass nil value for any of the parameters - it will use defaults for eligibility check if you do so.
[Wootric setCustomValueForResurveyThrottle:<NUMBER_OF_DAYS> visitorPercentage:<0-100> registeredPercentage:<0-100> dailyResponseCap:<0-...>];
// You can pass nil value for any of the parameters - it will use defaults for eligibility check if you do so.
Wootric.setCustomValueForResurveyThrottle(<NUMBER_OF_DAYS>, visitorPercentage:<0-100>, registeredPercentage:<0-100>, dailyResponseCap:<0-...>)
// You can pass nil value for any of the parameters - it will use defaults for eligibility check if you do so.
Wootric.setCustomValueForResurveyThrottle(<NUMBER_OF_DAYS>, visitorPercentage:<0-100>, registeredPercentage:<0-100>, dailyResponseCap:<0-...>)

This method will alter the values of resurvey throttle, tested visitor, registered users percentage and daily response cap used for eligibility check.

setCustomFollowupQuestionForPromoter:passive:detractor:

[Wootric setCustomFollowupQuestionForPromoter:<CUSTOM_QUESTION> passive:<CUSTOM_QUESTION> detractor:<CUSTOM_QUESTION>];
Wootric.setCustomFollowupQuestionForPromoter(<CUSTOM_QUESTION>, passive:<CUSTOM_QUESTION>, detractor:<CUSTOM_QUESTION>)
Wootric.setCustomFollowupQuestionForPromoter(<CUSTOM_QUESTION>, passive:<CUSTOM_QUESTION>, detractor:<CUSTOM_QUESTION>)

This method allows you to set custom question for each type of end user (detractor, passive or promoter). Passing nil for any of the parameters will result in using defaults set in Wootric’s admin panel for that type of end user.

setCustomFollowupPlaceholderForPromoter:passive:detractor:

[Wootric setCustomFollowupPlaceholderForPromoter:<CUSTOM_PLACEHOLDER> passive:<CUSTOM_PLACEHOLDER> detractor:<CUSTOM_PLACEHOLDER>];
Wootric.setCustomFollowupPlaceholderForPromoter(<CUSTOM_PLACEHOLDER>, passive:<CUSTOM_PLACEHOLDER>, detractor:<CUSTOM_PLACEHOLDER>)
Wootric.setCustomFollowupPlaceholderForPromoter(<CUSTOM_PLACEHOLDER>, passive:<CUSTOM_PLACEHOLDER>, detractor:<CUSTOM_PLACEHOLDER>)

Same as with custom question, it allows you to set custom placeholder text in feedback text view for each type of end user. Be advised that this setting takes precedence over values set in Wootric’s from admin panel.

Custom language, audience text and product name configuration:


[Wootric setCustomLanguage:<LANGUAGE_CODE>];
[Wootric setCustomAudience:<CUSTOM_AUDIENCE>];
[Wootric setCustomProductName:<CUSTOM_PRODUCT_NAME>];
Wootric.setCustomLanguage(<LANGUAGE_CODE>)
Wootric.setCustomAudience(<CUSTOM_AUDIENCE>)
Wootric.setCustomProductName(<CUSTOM_PRODUCT_NAME>)
Wootric.setCustomLanguage(<LANGUAGE_CODE>)
Wootric.setCustomAudience(<CUSTOM_AUDIENCE>)
Wootric.setCustomProductName(<CUSTOM_PRODUCT_NAME>)

Please refer to our docs for available languages.

Custom audience and/or product name modifies the default NPS question e.g. default question in English looks like this: “How likely are you to recommend this product or service to a friend or co-worker?” if custom product name is set it will substitute “this product or service” text, while custom audience will substitute “friend or co-worker”. It also takes precedence over values set in admin panel.

Custom Thank You


// Social share setup
[Wootric setFacebookPage:<FACEBOOK_PAGE_URL>];
[Wootric setTwitterHandler:<TWITTER_HANDLER>];

// Custom thank you messages setup
[Wootric setThankYouMessage:<THANK_YOU_MESSAGE>];
[Wootric setDetractorThankYouMessage:<THANK_YOU_MESSAGE>];
[Wootric setPassiveThankYouMessage:<THANK_YOU_MESSAGE>];
[Wootric setPromoterThankYouMessage:<THANK_YOU_MESSAGE>];

// Custom thank you button setup
[Wootric setThankYouLinkWithText:<THANK_YOU_TEXT> URL:<THANK_YOU_URL>];
[Wootric setDetractorThankYouLinkWithText:<THANK_YOU_TEXT> URL:<THANK_YOU_URL>];
[Wootric setPassiveThankYouLinkWithText:<THANK_YOU_TEXT> URL:<THANK_YOU_URL>];
[Wootric setPromoterThankYouLinkWithText:<THANK_YOU_TEXT> URL:<THANK_YOU_URL>];
// Social share setup
Wootric.setFacebookPage(<FACEBOOK_PAGE_URL>)
Wootric.setTwitterHandler(<TWITTER_HANDLER>)

// Custom thank you messages setup
Wootric.setThankYouMessage(<THANK_YOU_MESSAGE>)
Wootric.setDetractorThankYouMessage(<THANK_YOU_MESSAGE>)
Wootric.setPassiveThankYouMessage(<THANK_YOU_MESSAGE>)
Wootric.setPromoterThankYouMessage(<THANK_YOU_MESSAGE>)

// Custom thank you button setup
Wootric.setThankYouLinkWithText(<THANK_YOU_TEXT>, URL:<THANK_YOU_URL>)
Wootric.setDetractorThankYouLinkWithText(<THANK_YOU_TEXT>, URL:<THANK_YOU_URL>)
Wootric.setPassiveThankYouLinkWithText(<THANK_YOU_TEXT>, URL:<THANK_YOU_URL>)
Wootric.setPromoterThankYouLinkWithText(<THANK_YOU_TEXT>, URL:<THANK_YOU_URL>)
// Social share setup
Wootric.setFacebookPage(<FACEBOOK_PAGE_URL>)
Wootric.setTwitterHandler(<TWITTER_HANDLER>)

// Custom thank you messages setup
Wootric.setThankYouMessage(<THANK_YOU_MESSAGE>)
Wootric.setDetractorThankYouMessage(<THANK_YOU_MESSAGE>)
Wootric.setPassiveThankYouMessage(<THANK_YOU_MESSAGE>)
Wootric.setPromoterThankYouMessage(<THANK_YOU_MESSAGE>)

// Custom thank you button setup
Wootric.setThankYouLinkWithText(<THANK_YOU_TEXT>, url:<THANK_YOU_URL>)
Wootric.setDetractorThankYouLinkWithText(<THANK_YOU_TEXT>, url:<THANK_YOU_URL>)
Wootric.setPassiveThankYouLinkWithText(<THANK_YOU_TEXT>, url:<THANK_YOU_URL>)
Wootric.setPromoterThankYouLinkWithText(<THANK_YOU_TEXT>, url:<THANK_YOU_URL>)

If configured, social share will display third screen for promoters (score 9-10, also twitter displays only if there is a feedback text provided), while custom thank you message and/or button will display for each type of end user that is configured (where setThankYouMessage: and setThankYouLinkWithText:URL: being default for any score).

For detailed information please refer to js docs.

Color Customization (iPhone only)


// Change slider color
[Wootric setSliderColor:<UI_COLOR>];

// Change Send button color
[Wootric setSendButtonBackgroundColor:<UI_COLOR>];

// Change Thank You button color
[Wootric setThankYouButtonBackgroundColor:<UI_COLOR>];

// Change Social buttons color
[Wootric setSocialSharingColor:<UI_COLOR>];
// Change slider color
Wootric.setSliderColor(<UI_COLOR>)

// Change Send button color
Wootric.setSendButtonBackgroundColor(<UI_COLOR>)

// Change Thank You button color
Wootric.setThankYouButtonBackgroundColor(<UI_COLOR>)

// Change Social buttons color
Wootric.setSocialSharingColor(<UI_COLOR>)
// Change slider color
Wootric.setSliderColor(<UI_COLOR>)

// Change Send button color
Wootric.setSendButtonBackgroundColor(<UI_COLOR>)

// Change Thank You button color
Wootric.setThankYouButtonBackgroundColor(<UI_COLOR>)

// Change Social buttons color
Wootric.setSocialSharing(<UI_COLOR>)

Appereance of the survey can be modified to match your apps colors. The survey slider, Send button, Thank You button and all social sharing buttons can be modified.

Additional information

First survey after & end user created at setting: While it is not required, setting setEndUserCreatedAt is highly recommended for proper checking if end user needs survey and skipping uneccessary eligibility checks.

Samples

Rate application on the App Store

#import <WootricSDK/WootricSDK.h>

...

[Wootric configureWithClientID:clientID clientSecret:clientSecret accountToken:accountToken];
[Wootric setEndUserEmail:@"nps@example.com"];
[Wootric setEndUserCreatedAt:@1234567890];

// Replace YOUR_APP_ID with your application's id. 
// e.g. https://itunes.apple.com/en/app/YOUR_APP_NAME/id123456789
// The app id would 123456789
NSURL *appStoreURL = [NSURL URLWithString:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=YOUR_APP_ID&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software"];

// Uncomment to set ThankYouLink for all users
//[Wootric setThankYouLinkWithText:@"Rate our app!" URL:appStoreURL];

// Will set Link only for promoters
[Wootric setPromoterThankYouLinkWithText:@"Rate our app!" URL:appStoreURL];

// Will skip the Feedback view for Promoters
[Wootric skipFeedbackScreenForPromoter:YES];

// Uncomment for testing
// NOTE: do not use on production
//[Wootric forceSurvey:YES];

[Wootric showSurveyInViewController:self];
Wootric.configureWithClientID(clientID, clientSecret:clientSecret, accountToken:accountToken)
Wootric.setEndUserEmail("nps@example.com")
Wootric.setEndUserCreatedAt(1234567890)

// Replace YOUR_APP_ID with your application's id.
// e.g. https://itunes.apple.com/en/app/YOUR_APP_NAME/id123456789
// The app id would 123456789
let appStoreURL = NSURL(string: "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=YOUR_APP_ID&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software")

// Uncomment to set ThankYouLink for all users
// Wootric.setThankYouLinkWithText("Rate our app!", URL:appStoreURL);

// Will set Link only for promoters
Wootric.setPromoterThankYouLinkWithText("Rate our app!", URL:appStoreURL)

// Will skip the Feedback view for Promoters
Wootric.skipFeedbackScreenForPromoter(true)

// Uncomment for testing
// NOTE: do not use on production
// Wootric.forceSurvey(true)

Wootric.showSurveyInViewController(self)
Wootric.configure(withClientID: clientID, clientSecret:clientSecret, accountToken:accountToken)
Wootric.setEndUserEmail("nps@example.com")
Wootric.setEndUserCreatedAt(1234567890)

// Replace YOUR_APP_ID with your application's id.
// e.g. https://itunes.apple.com/en/app/YOUR_APP_NAME/id123456789
// The app id would 123456789
let appStoreURL = URL(string: "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=YOUR_APP_ID&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software")

// Uncomment to set ThankYouLink for all users
// Wootric.setThankYouLinkWithText("Rate our app!", url:appStoreURL);

// Will set Link only for promoters
Wootric.setPromoterThankYouLinkWithText("Rate our app!", url:appStoreURL)

// Will skip the Feedback view for Promoters
Wootric.skipFeedbackScreen(forPromoter: true)

// Uncomment for testing
// NOTE: do not use on production
// Wootric.forceSurvey(true)

Wootric.showSurvey(in: self)

You can set the last button to go to the App Store so users can rate your app.

Wootric

Set End User Properties

#import <WootricSDK/WootricSDK.h>

...

[Wootric configureWithClientID:clientID clientSecret:clientSecret accountToken:accountToken];

[Wootric setEndUserEmail:@"nps@example.com"];

// Uncomment for testing
// NOTE: do not use in production
// [Wootric forceSurvey:YES];

// Set end user's properties
NSMutableDictionary *properties = [NSMutableDictionary new];
[properties setObject:@"Wootric" forKey:@"company"];
[properties setObject:@"awesome" forKey:@"type"];
[properties setObject:@"iOS" forKey:@"os"];
// Integer representing the date (Unix timestamp format) of the user's last order with the key suffixed with "_date"
[properties setObject:@1479316287 forKey:@"last_order_date"];
// Integer representing the user's total purchases with the key suffixed with "_amount"
[properties setObject:@10 forKey:@"total_purchase_amount"];

[Wootric setEndUserProperties:properties];

[Wootric showSurveyInViewController:self];
Wootric.configureWithClientID(clientID, clientSecret:clientSecret, accountToken:accountToken)

Wootric.setEndUserEmail("nps@example.com")

// Uncomment for testing
// NOTE: do not use in production
// Wootric.forceSurvey(true)

// Set end user's properties
// Integer representing the date (Unix timestamp format) of the user's last order with the key suffixed with "_date"
// Integer representing the user's total purchases with the key suffixed with "_amount"
let properties: [String: String] = [
  "company" : "Wootric",
  "type" : "awesome",
  "os" : "iOS",
  "last_order_date" : "1479316287",
  "total_purchase_amount" : "10"
]
Wootric.setEndUserProperties(properties)

Wootric.showSurveyInViewController(self)
Wootric.configure(withClientID: clientID, clientSecret:clientSecret, accountToken:accountToken)

Wootric.setEndUserEmail("nps@example.com")

// Uncomment for testing
// NOTE: do not use in production
// Wootric.forceSurvey(true)

// Set end user's properties
// Integer representing the date (Unix timestamp format) of the user's last order with the key suffixed with "_date"
// Integer representing the user's total purchases with the key suffixed with "_amount"
let properties: [String: String] = [
  "company" : "Wootric",
  "type" : "awesome",
  "os" : "iOS",
  "last_order_date" : "1479316287",
  "total_purchase_amount" : "10"
]
Wootric.setEndUserProperties(properties)

Wootric.showSurvey(in: self)

Setting end user properties will help you segment and filter results.

Wootric currently supports Integers, Strings, and Unix formatted dates as values.

Integers must be suffixed with _amount and dates must be in Unix timestamp format and suffixed with _date.

Keys cannot contain characters such as ‘$’, ‘.’ or the NULL character. Values cannot be nested hashes or arrays.

Properties

Troubleshooting

Survey not showing up or is blank?

Check that client ID, client secret and account token are correct. Account token should have a “NPS-xxxxxxxx” format

I’m using forceSurvey but getting User not eligible

Check that Wootric Mobile Switch is enabled on your Acount Settings

Wootric

Segment Integration

Wootric provides an integration for Segment. The library can be found on our Github.

Install with Cocoapods

Segment-Wootric is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Segment-Wootric"

Usage

#import <Segment-Wootric/SegmentWootric.h>

SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_WRITE_KEY"];
WTRWootricIntegrationFactory *wootricFactory = [WTRWootricIntegrationFactory instance];
[config use:wootricFactory];
[SEGAnalytics setupWithConfiguration:config];

[WTRWootricIntegration showSurveyInViewController:<VIEW_CONTROLLER>];
let config = SEGAnalyticsConfiguration.init(writeKey: "YOUR_WRITE_KEY")

let wootricFactory = WTRWootricIntegrationFactory.instance() as! WTRWootricIntegrationFactory
config.use(wootricFactory)
SEGAnalytics.setupWithConfiguration(config)

WTRWootricIntegration.showSurveyInViewController(self)
let config = SEGAnalyticsConfiguration.init(writeKey: "1232135234124123")

let wootricFactory = WTRWootricIntegrationFactory.instance() as! WTRWootricIntegrationFactory
config?.use(wootricFactory)
SEGAnalytics.setup(with: config)

WTRWootricIntegration.showSurvey(in: self)

First of all you need to provide values for account token, clientID and client secret in Segment’s dashboard for Wootric integration, then import Segment-Wootric.

Then init the Analytics with Wootric integration. Wootric integration responds to identify call, to read more about it, visit Segment identify method documentation. In identify call traits dictionary is set as endUserProperties in WootricSDK, except keys email and createdAt which are set as endUserEmail and endUserCreatedAt respectively.

For custom configuration you can use SEGWootric class instance, to get it, call: [WTRWootricIntegration wootric] For all available methods (being instace methods for SEGWootric instead of class methods) please refer to WootricSDK docs.

Finally to show the survey with showSurveyInViewController.

mParticle Integration

Wootric provides an integration for mParticle.

Instructions on how to setup the mParticle Apple SDK can be found on mParticle’s Github.