mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-24 06:35:37 +00:00
fix(analytics): drop cap and Stripe platform fixes
This commit is contained in:
parent
98de7f634d
commit
593149abe6
2 changed files with 13 additions and 8 deletions
|
|
@ -177,15 +177,15 @@ export default function randomDrop (user, options, req = {}, analytics) {
|
|||
message: i18n.t('dropCapReached', req.language),
|
||||
items: dropN,
|
||||
});
|
||||
}
|
||||
|
||||
if (isEnrolledInDropCapTest) {
|
||||
analytics.track('drop cap reached', {
|
||||
uuid: user._id,
|
||||
dropCap: maxDropCount,
|
||||
category: 'behavior',
|
||||
headers: req.headers,
|
||||
});
|
||||
if (isEnrolledInDropCapTest) {
|
||||
analytics.track('drop cap reached', {
|
||||
uuid: user._id,
|
||||
dropCap: maxDropCount,
|
||||
category: 'behavior',
|
||||
headers: req.headers,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (analytics && moment().diff(user.auth.timestamps.created, 'days') < 7) {
|
||||
|
|
|
|||
|
|
@ -251,6 +251,11 @@ function _sendDataToGoogle (eventType, data) {
|
|||
function _sendPurchaseDataToAmplitude (data) {
|
||||
const amplitudeData = _formatDataForAmplitude(data);
|
||||
|
||||
// Stripe transactions come via webhook. We can log these as Web events
|
||||
if (data.paymentMethod === 'Stripe' && amplitudeData.platform === 'Unknown') {
|
||||
amplitudeData.platform = 'Web';
|
||||
}
|
||||
|
||||
amplitudeData.event_type = 'purchase';
|
||||
amplitudeData.revenue = data.purchaseValue;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue