diff --git a/services/web/app/src/Features/Subscription/RecurlyEventHandler.js b/services/web/app/src/Features/Subscription/RecurlyEventHandler.js index ea977a8a35..aed0f922ae 100644 --- a/services/web/app/src/Features/Subscription/RecurlyEventHandler.js +++ b/services/web/app/src/Features/Subscription/RecurlyEventHandler.js @@ -66,6 +66,7 @@ async function _sendSubscriptionUpdatedEvent(eventData) { AnalyticsManager.recordEventForUser(userId, 'subscription-updated', { plan_code: planCode, quantity, + is_trial: isTrial, }) AnalyticsManager.setUserPropertyForUser( userId, diff --git a/services/web/app/src/Features/Subscription/SubscriptionController.js b/services/web/app/src/Features/Subscription/SubscriptionController.js index f0c7786a85..95a1126acc 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionController.js +++ b/services/web/app/src/Features/Subscription/SubscriptionController.js @@ -421,6 +421,10 @@ async function extendTrial(req, res) { try { await SubscriptionHandler.promises.extendTrial(subscription, 14) + AnalyticsManager.recordEventForSession( + req.session, + 'subscription-trial-extended' + ) } catch (error) { return res.sendStatus(500) } diff --git a/services/web/test/unit/src/Subscription/RecurlyEventHandlerTests.js b/services/web/test/unit/src/Subscription/RecurlyEventHandlerTests.js index 1c1cb18564..b761289a5f 100644 --- a/services/web/test/unit/src/Subscription/RecurlyEventHandlerTests.js +++ b/services/web/test/unit/src/Subscription/RecurlyEventHandlerTests.js @@ -120,6 +120,7 @@ describe('RecurlyEventHandler', function () { { plan_code: this.planCode, quantity: 1, + is_trial: true, } ) sinon.assert.calledWith(