Merge pull request #4186 from overleaf/ab-expired-sub-plan-code-prop

Keep subscription plan code user property when a subscription expires

GitOrigin-RevId: 195bfa440dc3fb020f4cbefe44f87bc975aade70
This commit is contained in:
Alexandre Bourdin 2021-06-11 12:18:43 +02:00 committed by Copybot
parent 669bec323c
commit bb760a3ee2
2 changed files with 7 additions and 1 deletions

View file

@ -78,7 +78,7 @@ function _sendSubscriptionExpiredEvent(eventData) {
quantity, quantity,
is_trial: isTrial, is_trial: isTrial,
}) })
AnalyticsManager.setUserProperty(userId, 'subscription-plan-code', null) AnalyticsManager.setUserProperty(userId, 'subscription-plan-code', planCode)
AnalyticsManager.setUserProperty(userId, 'subscription-state', state) AnalyticsManager.setUserProperty(userId, 'subscription-state', state)
AnalyticsManager.setUserProperty(userId, 'subscription-is-trial', isTrial) AnalyticsManager.setUserProperty(userId, 'subscription-is-trial', isTrial)
} }

View file

@ -188,6 +188,12 @@ describe('RecurlyEventHandler', function () {
is_trial: true, is_trial: true,
} }
) )
sinon.assert.calledWith(
this.AnalyticsManager.setUserProperty,
this.userId,
'subscription-plan-code',
this.planCode
)
sinon.assert.calledWith( sinon.assert.calledWith(
this.AnalyticsManager.setUserProperty, this.AnalyticsManager.setUserProperty,
this.userId, this.userId,