This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You define a global variable to track your events | |
my_global_event_name = 'loaded_website'; | |
// You define your WootricSettings variable at the beginning of the code | |
wootricSettings = { | |
account_token: 'NPS-YOURTOKEN', | |
email: '[email protected]', | |
created_at: 1528416000, | |
properties: { | |
favorite_color: 'blue' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
window.wootricSettings = { | |
email:'[email protected]', | |
created_at: 1528416000, | |
product_name: 'HUBSPOT NPS', | |
account_token: 'NPS-xxxxxxxx', | |
properties:{ | |
pricing_plan:'pro', | |
favorite_color: 'red' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="https://cdn.wootric.com/wootric-sdk.js"></script> | |
<script type="text/javascript"> | |
var user_email = user.email; // Mocking a backend object | |
var blackListedDomain = 'wootric.com'; | |
if (user_email.indexOf(blackListedDomain) != -1) { | |
window.wootricSettings = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.1' | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:5.3.3 | |
hostname: elasticsearch | |
ports: | |
- 9210:9200 | |
- 9310:9300 | |
environment: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# General example with all params | |
curl -X POST \ | |
https://api.wootric.com/v1/email_survey \ | |
-H 'Authorization: Bearer YOUR-TOKEN' \ | |
-F 'emails[][email protected]' \ | |
-F 'survey_settings[sampling][response_throttle]=0' \ | |
-F 'survey_settings[sampling][registered_percent]=100' \ | |
-F 'survey_settings[sampling][first_survey_delay]=0' \ | |
-F 'survey_settings[sampling][decline_throttle]=1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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: '[email protected]', | |
dashboard_language: 'EN', | |
registration_date: 1496880000 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- begin Wootric code --> | |
<script type="text/javascript"> | |
wootric_survey_immediately = true; //TODO:comment this in production | |
window.wootricSettings = { | |
email:'[email protected]', //TODO: Required to uniquely identify a user. Email is recommended but this can be any unique identifier. | |
created_at: 1234567890, //TODO:replace it with date when your customer signed up | |
account_token: 'NPS-XXXX', //TODO:replace it with your account token | |
properties: {} //Make sure you initialize it, with or without values. | |
}; | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Only eligible in second account | |
var token_list = ['NPS-5cb686c1', 'NPS-8296bf77']; | |
var wootricSettings = { | |
account_token: '' | |
}; | |
//wootric_survey_immediately = true; | |
//wootric_no_surveyed_cookie = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Open rails console | |
# type: load 'custom_samplings_generator.rb' | |
# type: seed('NPS-YourToken') | |
# Go to /account_sampling_rules.json?account_token=NPS-YourToken in Survey Server | |
# | |
RULES = %w( | |
on_click | |
on_login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="Content-Security-Policy" | |
content="connect-src https://*.wootric.com; | |
script-src 'nonce-EBVmWKEBEP' 'nonce-iApyYLoklC' 'strict-dynamic'; | |
object-src 'none'; | |
base-uri 'none'; | |
img-src 'self' data; | |
font-src 'self' data:;" /> |
NewerOlder