This file contains hidden or 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
| Appcues.on('all', function(eventId, data) { | |
| if (analytics != null && analytics.track && eventId === 'flow_analytics') { | |
| var desc = typeof data === 'string' ? data : data.description; | |
| analytics.track(desc, Appcues.user()); | |
| } | |
| } |
This file contains hidden or 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
| /* Set the color of the back buttons to Appcues blue. */ | |
| .appcues-button { | |
| background-color: #4baad3; | |
| } | |
| .appcues-button:hover { | |
| background-color: #247294; /* A bit darker. */ | |
| } | |
| .appcues-button.appcues-button-success { |
This file contains hidden or 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
| requirejs.config({ | |
| "paths": { | |
| "appcues": "//fast.appcues.com/<your_appcues_id>" | |
| } | |
| }); | |
| // Later in your app. | |
| define(['models/user', 'appcues'], function(user, Appcues) { | |
| Appcues.identify(user.id, { | |
| email: user.email, |
This file contains hidden or 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
| // Ensure our properties aren't tracked. | |
| (function () { | |
| var currentWindow, | |
| result = {}, | |
| iframe = document.createElement('iframe'); | |
| // Get a clean window object from this iframe. | |
| iframe.style.display = 'none'; | |
| document.body.appendChild(iframe); | |
This file contains hidden or 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
| # Regex for ONE optional whitespace. | |
| # NOTE: Replace `?` with `*` to make it more lenient. | |
| nbsp = '[\\s\\xA0]\?' | |
| templatize = (str, context) -> | |
| # If no object just return string. | |
| if not context or typeof context isnt 'object' | |
| return str | |
| # Loop through keys and replace placeholders. |
This file contains hidden or 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
| var _vis_opt_queue = window._vis_opt_queue || [], _vis_counter = 0; | |
| _vis_opt_queue.push(function() { | |
| try { | |
| if(!_vis_counter) { | |
| var _vis_data = {},_vis_combination,_vis_id,_vis_l=0; | |
| for(;_vis_l<_vwo_exp_ids.length;_vis_l++) { | |
| _vis_id = _vwo_exp_ids[_vis_l]; | |
| if(_vwo_exp[_vis_id].ready) { | |
| _vis_combination = _vis_opt_readCookie('_vis_opt_exp_'+_vis_id+'_combi'); | |
| if(typeof(_vwo_exp[_vis_id].combination_chosen) != "undefined") |
This file contains hidden or 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
| // Create a special global variable that the Appcues script will look for upon load. | |
| // Admittedly, this should probably be called "AppcuesConfig". | |
| window.AppcuesIdentity = window.AppcuesIdentity || { | |
| appcuesId: 'foo', | |
| userId: 1234, | |
| userEmail: '[email protected]' | |
| }; | |
| // Asynchronously load Appcues embed script. | |
| asyncLoadAppcues().then(function() { |
This file contains hidden or 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
| values = [ | |
| 13.626332 | |
| 47.989636 | |
| 9.596008 | |
| 28.788024 | |
| ] | |
| # Round these percentage values into integers, ensuring that they equal 100% at the end. | |
| roundedValues = getLargestRemainder values, 100 | |
| # [14, 48, 9, 29] |