diff --git a/services/web/app/views/layout.jade b/services/web/app/views/layout.jade index 83d7da4838..3c781a4b9f 100644 --- a/services/web/app/views/layout.jade +++ b/services/web/app/views/layout.jade @@ -46,76 +46,6 @@ html(itemscope, itemtype='http://schema.org/Product') - else script(type='text/javascript'). window.ga = function() { console.log("would send to GA", arguments) }; - - // Countly Analytics - if (settings.analytics && settings.analytics.countly && settings.analytics.countly.token) - script(type="text/javascript"). - var Countly = Countly || {}; - Countly.q = Countly.q || []; - Countly.app_key = '#{settings.analytics.countly.token}'; - Countly.url = '#{settings.analytics.countly.server}'; - !{ session.user ? 'Countly.device_id = "' + session.user._id + '";' : '' } - - (function() { - var cly = document.createElement('script'); cly.type = 'text/javascript'; - cly.async = true; - //enter url of script here - cly.src = 'https://cdnjs.cloudflare.com/ajax/libs/countly-sdk-web/16.6.0/countly.min.js'; - cly.onload = function(){Countly.init()}; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(cly, s); - })(); - - script(type="text/javascript") - if (session && session.user) - - var name = session.user.first_name + (session.user.last_name ? ' ' + session.user.last_name : ''); - | Countly.q.push(['user_details', { email: '#{session.user.email}', name: '#{name}' }]); - - if (justRegistered) - | Countly.q.push(['add_event',{ key: 'user-registered' }]); - - if (justLoggedIn) - | Countly.q.push(['add_event',{ key: 'user-logged-in' }]); - - if (user && user.features) - - featureFlagSet = false; - - if user.features.hasOwnProperty('collaborators') - | Countly.q.push([ 'userData.set', 'features-collaborators', #{ user.features.collaborators } ]); - - featureFlagSet = true; - - if user.features.hasOwnProperty('compileGroup') - | Countly.q.push([ 'userData.set', 'features-compileGroup', '#{ user.features.compileGroup }' ]); - - featureFlagSet = true; - - if user.features.hasOwnProperty('compileTimeout') - | Countly.q.push([ 'userData.set', 'features-compileTimeout', #{ user.features.compileTimeout } ]); - - featureFlagSet = true; - - if user.features.hasOwnProperty('dropbox') - | Countly.q.push([ 'userData.set', 'features-dropbox', #{ user.features.dropbox } ]); - - featureFlagSet = true; - - if user.features.hasOwnProperty('github') - | Countly.q.push([ 'userData.set', 'features-github', #{ user.features.github } ]); - - featureFlagSet = true; - - if user.features.hasOwnProperty('references') - | Countly.q.push([ 'userData.set', 'features-references', #{ user.features.references } ]); - - featureFlagSet = true; - - if user.features.hasOwnProperty('templates') - | Countly.q.push([ 'userData.set', 'features-templates', #{ user.features.templates } ]); - - featureFlagSet = true; - - if user.features.hasOwnProperty('versioning') - | Countly.q.push([ 'userData.set', 'features-versioning', #{ user.features.versioning } ]); - - featureFlagSet = true; - - - if featureFlagSet - | Countly.q.push(['userData.save']) - - // End countly Analytics script(type="text/javascript"). window.csrfToken = "#{csrfToken}";