mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Facebook pixel Revert (3rd time's a charm?) (#8450)
* attempt revert * Add back unrelated stuff
This commit is contained in:
@@ -32,17 +32,6 @@
|
||||
}, window['ga'].l = 1 * new Date();
|
||||
ga('create', window.env.GA_ID, user ? {'userId': user._id} : undefined);
|
||||
|
||||
// Facebook
|
||||
var n = window.fbq = function() {
|
||||
n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments)
|
||||
};
|
||||
if (!window._fbq) window._fbq = n;
|
||||
n.push = n;
|
||||
n.loaded = !0;
|
||||
n.version = '2.0';
|
||||
n.queue = [];
|
||||
fbq('init', window.env.FACEBOOK_ANALYTICS);
|
||||
|
||||
function loadScripts() {
|
||||
setTimeout(function() {
|
||||
// Amplitude
|
||||
@@ -56,22 +45,16 @@
|
||||
// Google Analytics
|
||||
var a = document.createElement('script');
|
||||
var m = document.getElementsByTagName('script')[0];
|
||||
a.async = true;
|
||||
a.async = 1;
|
||||
a.src = '//www.google-analytics.com/analytics.js';
|
||||
m.parentNode.insertBefore(a, m);
|
||||
|
||||
// Facebook
|
||||
var t = document.createElement('script');
|
||||
var f = document.getElementsByTagName('script')[0];
|
||||
t.async = true;
|
||||
t.src = 'https://connect.facebook.net/en_US/fbevents.js';
|
||||
f.parentNode.insertBefore(t, f);
|
||||
});
|
||||
}
|
||||
|
||||
function register() {
|
||||
setTimeout(function() {
|
||||
fbq('track', 'CompleteRegistration');
|
||||
amplitude.setUserId(user._id);
|
||||
ga('set', {'userId':user._id});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -89,9 +72,6 @@
|
||||
|
||||
amplitude.logEvent(properties.eventAction,properties);
|
||||
ga('send',properties);
|
||||
if(properties.hitType === 'pageview') {
|
||||
fbq('track', 'PageView');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user