Remove Countly integration.

This commit is contained in:
Paulo Reis 2016-08-10 17:34:32 +01:00
parent 6a3372fcbf
commit b405b4dce6

View file

@ -46,76 +46,6 @@ html(itemscope, itemtype='http://schema.org/Product')
- else - else
script(type='text/javascript'). script(type='text/javascript').
window.ga = function() { console.log("would send to GA", arguments) }; 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"). script(type="text/javascript").
window.csrfToken = "#{csrfToken}"; window.csrfToken = "#{csrfToken}";