Facebook pixel Revert (3rd time's a charm?) (#8450)

* attempt revert

* Add back unrelated stuff
This commit is contained in:
MathWhiz
2017-01-23 14:42:57 -06:00
committed by Sabe Jones
parent 79b51a40ce
commit 42c5e6c22b
5 changed files with 17 additions and 42 deletions

View File

@@ -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');
}
});
}