Skip to content

Commit

Permalink
Merge pull request #1926 from CodeNow/SAN-5498-mixpanel-proxy
Browse files Browse the repository at this point in the history
Add ability to set mixpanel proxy url
  • Loading branch information
thejsj authored Dec 6, 2016
2 parents cf746b9 + b9c645e commit db17775
Show file tree
Hide file tree
Showing 3 changed files with 5,477 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ module.exports = function(grunt) {
env: 'production', // require('./client/config/json/environment.json').environment,
commitHash: require('./client/config/json/commit.json').commitHash,
commitTime: require('./client/config/json/commit.json').commitTime,
apiHost: require('./client/config/json/api.json').host
apiHost: require('./client/config/json/api.json').host,
mixpanelProxyUrl: require('./client/config/json/api.json').mixpanelProxyUrl
};
locals.rollbarEnv = locals.env;
if (locals.apiHost.indexOf('runnable-beta.com') > -1) {
Expand Down Expand Up @@ -434,6 +435,7 @@ module.exports = function(grunt) {
function (cb) {
var configObj = {};
configObj.host = process.env.API_URL || 'https://api-staging-codenow.runnableapp.com/';
configObj.mixpanelProxyUrl = process.env.MIXPANEL_PROXY_URL || 'api.mixpanel.com';
configObj.socketHost = process.env.API_SOCK_URL || configObj.host;
configObj.userContentDomain = process.env.USER_CONTENT_DOMAIN || 'runnableapp.com';
configObj.corporateUrl = process.env.MARKETING_URL || 'https://runnable.io';
Expand Down
4 changes: 2 additions & 2 deletions layout.jade
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ html(
script.
(function(f,b){if(!b.__SV){var a,e,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=f.createElement("script");a.type="text/javascript";a.async=!0;a.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";e=f.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}})(document,window.mixpanel||[]);
mixpanel.init("57260a5b6fc972e9c69184882efd009e");
mixpanel.init("57260a5b6fc972e9c69184882efd009e", { api_host: "#{locals.mixpanelProxyUrl}" });
else
script.
(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
mixpanel.init("497564c7e1dc7e803edc5d4ca8583653");
mixpanel.init("497564c7e1dc7e803edc5d4ca8583653", { api_host: "#{locals.mixpanelProxyUrl}" });

body(
ng-class = "{'modal-open': ModalService.modalLayers.length > 0 || dataApp.data.modalError.data.in || dataApp.data.modalOpen}"
Expand Down
Loading

0 comments on commit db17775

Please sign in to comment.