Skip to content
Snippets Groups Projects
Commit 5768bc32 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge pull request #1137 from metabase/remove_intercom

remove Intercom from main repo.
parents 44b8e732 7a7aba5d
Branches
Tags
No related merge requests found
......@@ -43,14 +43,6 @@ MetabaseServices.factory('AppState', ['$rootScope', '$q', '$location', '$interva
}, function(error) {
deferred.resolve();
});
// start Intercom updater
// this tells Intercom to update every 60s if we have a currently logged in user
$interval(function() {
if (service.model.currentUser && MetabaseSettings.isTrackingEnabled()) {
window.Intercom('update');
}
}, 60000);
}
return initPromise;
......@@ -184,18 +176,6 @@ MetabaseServices.factory('AppState', ['$rootScope', '$q', '$location', '$interva
}
};
function startupIntercom(user) {
window.Intercom('boot', {
app_id: "gqfmsgf1",
name: user.common_name,
email: user.email
});
}
function teardownIntercom() {
window.Intercom('shutdown');
}
// listen for location changes and use that as a trigger for page view tracking
$rootScope.$on('$locationChangeSuccess', function() {
// NOTE: we are only taking the path right now to avoid accidentally grabbing sensitive data like table/field ids
......@@ -220,15 +200,6 @@ MetabaseServices.factory('AppState', ['$rootScope', '$q', '$location', '$interva
Session.delete({
'session_id': session_id
});
// close down intercom
teardownIntercom();
});
$rootScope.$on("appstate:user", function(event, user) {
if (MetabaseSettings.isTrackingEnabled()) {
startupIntercom(user);
}
});
// enable / disable GA based on opt-out of anonymous tracking
......@@ -237,17 +208,9 @@ MetabaseServices.factory('AppState', ['$rootScope', '$q', '$location', '$interva
if (MetabaseSettings.isTrackingEnabled()) {
// we are doing tracking
window['ga-disable-'+ga_code] = null;
if (currentUserPromise) {
currentUserPromise.then(function(user) {
startupIntercom(user);
});
}
} else {
// tracking is disabled
window['ga-disable-'+ga_code] = true;
teardownIntercom();
}
});
......
......@@ -8,8 +8,6 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>Metabase</title>
<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://widget.intercom.io/widget/gqfmsgf1';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>
<script>
window.MetabaseBootstrap = {{{bootstrap_json}}};
</script>
......
......@@ -156,7 +156,6 @@
"Return a simple map of key/value pairs which represent the public settings for the front-end application."
[]
{:ga_code "UA-60817802-1"
:intercom_code "gqfmsgf1"
:password_complexity (password/active-password-complexity)
:setup_token (setup/token-value)
:timezones common/timezones
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment