Merge pull request #5031 from overleaf/ab-paywall-events

Merge paywall-prompt and paywall-click events

GitOrigin-RevId: d567631d08b89565f9a3049f9b88cc2d14a799c1
This commit is contained in:
Timothée Alby 2021-09-16 10:47:37 +02:00 committed by Copybot
parent cfd5a86184
commit c5f883ad83
5 changed files with 15 additions and 7 deletions

View file

@ -435,7 +435,9 @@ App.controller(
'editor-click-feature',
'compile-timeout'
)
eventTracking.sendMB('compile-timeout-paywall-prompt')
eventTracking.sendMB('paywall-prompt', {
'paywall-type': 'compile-timeout',
})
}
} else if (response.status === 'terminated') {
$scope.pdf.view = 'errors'

View file

@ -917,7 +917,9 @@ export default App.controller(
'editor-click-feature',
'real-time-track-changes'
)
eventTracking.sendMB('track-changes-paywall-prompt')
eventTracking.sendMB('paywall-prompt', {
'paywall-type': 'track-changes',
})
}
const _setUserTCState = function (userId, newValue, isLocal) {

View file

@ -9,7 +9,7 @@ function startFreeTrial(source, version, $scope) {
if (typeof ga === 'function') {
ga('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
}
eventTracking.sendMB(`${source}-paywall-click`)
eventTracking.sendMB('paywall-click', { 'paywall-type': source })
url = `/user/subscription/new?planCode=${plan}&ssp=true`
url = `${url}&itm_campaign=${source}`
@ -46,7 +46,7 @@ function upgradePlan(source, $scope) {
}
function paywallPrompt(source) {
eventTracking.sendMB(`${source}-paywall-prompt`)
eventTracking.sendMB('paywall-prompt', { 'paywall-type': source })
}
export { startFreeTrial, upgradePlan, paywallPrompt }

View file

@ -14,7 +14,7 @@ export default function StartFreeTrialButton({
const { t } = useTranslation()
useEffect(() => {
eventTracking.sendMB(`${source}-paywall-prompt`)
eventTracking.sendMB('paywall-prompt', { 'paywall-type': source })
}, [source])
const handleClick = useCallback(
@ -22,7 +22,7 @@ export default function StartFreeTrialButton({
event.preventDefault()
eventTracking.send('subscription-funnel', 'upgraded-free-trial', source)
eventTracking.sendMB(`${source}-paywall-click`)
eventTracking.sendMB('paywall-click', { 'paywall-type': source })
if (setStartedFreeTrial) {
setStartedFreeTrial(true)

View file

@ -612,7 +612,11 @@ describe('<ShareProjectModal/>', function () {
})
it('displays a message when the collaborator limit is reached', async function () {
fetchMock.post('/event/project-sharing-paywall-prompt', {})
fetchMock.post(
'/event/paywall-prompt',
{},
{ body: { 'paywall-type': 'project-sharing' } }
)
renderWithEditorContext(<ShareProjectModal {...modalProps} />, {
user: {