mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Revert "Analytics: track generic events through the server (#12735)"
This reverts commit 48dbe547c0.
This commit is contained in:
@@ -174,7 +174,7 @@ function _formatDataForAmplitude (data) {
|
||||
return ampData;
|
||||
}
|
||||
|
||||
function _sendDataToAmplitude (eventType, data, loggerOnly) {
|
||||
function _sendDataToAmplitude (eventType, data) {
|
||||
const amplitudeData = _formatDataForAmplitude(data);
|
||||
|
||||
amplitudeData.event_type = eventType;
|
||||
@@ -183,8 +183,6 @@ function _sendDataToAmplitude (eventType, data, loggerOnly) {
|
||||
logger.info('Amplitude Event', amplitudeData);
|
||||
}
|
||||
|
||||
if (loggerOnly) return Promise.resolve(null);
|
||||
|
||||
return amplitude
|
||||
.track(amplitudeData)
|
||||
.catch(err => logger.error(err, 'Error while sending data to Amplitude.'));
|
||||
@@ -314,9 +312,9 @@ function _setOnce (dataToSetOnce, uuid) {
|
||||
}
|
||||
|
||||
// There's no error handling directly here because it's handled inside _sendDataTo{Amplitude|Google}
|
||||
async function track (eventType, data, loggerOnly = false) {
|
||||
async function track (eventType, data) {
|
||||
const promises = [
|
||||
_sendDataToAmplitude(eventType, data, loggerOnly),
|
||||
_sendDataToAmplitude(eventType, data),
|
||||
_sendDataToGoogle(eventType, data),
|
||||
];
|
||||
if (data.user && data.user.registeredThrough) {
|
||||
|
||||
@@ -225,7 +225,7 @@ function trackCronAnalytics (analytics, user, _progress, options) {
|
||||
user,
|
||||
questName: user.party.quest.key,
|
||||
headers: options.headers,
|
||||
}, true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user