Skip to content

Instantly share code, notes, and snippets.

if (loggedIn) { //Whatever conditionals you need, if you need them
// begin Wootric code from setup guide (copy)
window.wootricSettings = {
email: 'nps@example.com',// TODO: The current logged in user's email address.
created_at: 1234567890, // TODO: The current logged in user's sign-up date as a 10 digit Unix timestamp.
account_token: 'NPS-xxxxxxx'
};
...
WootricSurvey.run();
// end Wootric code
@jumpingdeeps
jumpingdeeps / WootricFactory.js
Last active August 29, 2015 14:27
A way to load the Wootric snippet in a factory file so it can be fired in a single-page application with wootricFactory.run();
'use strict';
/**
* @ngdoc service
* @name wootricAngularApp.wootricFactory
* @description
* # wootricFactory
* Factory in the wootricAngularApp.
*/
angular.module('wootricAngularApp')
@jumpingdeeps
jumpingdeeps / WootricLibrary.js
Last active August 29, 2015 14:24
A way to load the Wootric snippet in a library file so it can be fired when there is an event with Wootric.wootric('run');
/**
* Created by jumpingdeeps on 6/7/15
*/
Wootric = {};
if (loggedIn) { //Whatever conditionals you need, if you need them
// begin Wootric code
window.wootricSettings = {
email: 'nps@example.com',// TODO: The current logged in user's email address.
created_at: 1234567890, // TODO: The current logged in user's sign-up date as a 10 digit Unix timestamp.
  • Log into your Slack channel
  • Click in configure integrations
  • Click on Incoming Webhooks and Add a new one
  • Copy the Webhook URL e.g. https://hooks.slack.com/services/
  • Set the response_callback in wootricSettings to window.woolib.notifySlack as well as the slack_hook_url

    Example:

<!--Example Intercom Settings-->
<script id="IntercomSettingsScriptTag">
window.intercomSettings = {
...
};
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://static.intercomcdn.com/intercom.v1.js';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
<!--end Example Intercom-->
<!-- begin example Wootric code -->