mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Revert "Analytics: track generic events through the server (#12735)"
This reverts commit 48dbe547c0.
This commit is contained in:
@@ -82,21 +82,14 @@ export function setUser () {
|
||||
window.ga('set', { userId: user._id });
|
||||
}
|
||||
|
||||
export function track (properties, options = {}) {
|
||||
export function track (properties) {
|
||||
// Use nextTick to avoid blocking the UI
|
||||
Vue.nextTick(() => {
|
||||
if (_doesNotHaveRequiredFields(properties)) return;
|
||||
if (_doesNotHaveAllowedHitType(properties)) return;
|
||||
|
||||
const trackOnServer = options && options.trackOnServer === true;
|
||||
if (trackOnServer === true) {
|
||||
// Track an event on the server
|
||||
const store = getStore();
|
||||
store.dispatch('analytics:trackEvent', properties);
|
||||
} else {
|
||||
amplitude.getInstance().logEvent(properties.eventAction, properties);
|
||||
window.ga('send', properties);
|
||||
}
|
||||
amplitude.getInstance().logEvent(properties.eventAction, properties);
|
||||
window.ga('send', properties);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user