mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Merge pull request #28438 from overleaf/dp-itm-content
Add itm-content param indicating split test variant to compile timeout paywalls GitOrigin-RevId: 809e13f8e548498d890c055d20d7ce30fd6ead7f
This commit is contained in:
committed by
Copybot
parent
0ef959d05b
commit
2879550770
+22
-1
@@ -11,7 +11,11 @@ import {
|
||||
populateEditorRedesignSegmentation,
|
||||
useEditorAnalytics,
|
||||
} from '@/shared/hooks/use-editor-analytics'
|
||||
import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
|
||||
import {
|
||||
isNewUser,
|
||||
useIsNewEditorEnabled,
|
||||
} from '@/features/ide-redesign/utils/new-editor-utils'
|
||||
import { getSplitTestVariant } from '@/utils/splitTestUtils'
|
||||
|
||||
export const ShortCompileTimeoutErrorState = () => {
|
||||
const { t } = useTranslation()
|
||||
@@ -41,6 +45,22 @@ export const ShortCompileTimeoutErrorState = () => {
|
||||
})
|
||||
}, [segmentation, sendEvent])
|
||||
|
||||
const extraSearchParams = useMemo(() => {
|
||||
if (!isNewUser()) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
const variant = getSplitTestVariant('editor-redesign-new-users')
|
||||
|
||||
if (!variant) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
return {
|
||||
itm_content: variant,
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<ErrorState
|
||||
title={t('your_compile_timed_out')}
|
||||
@@ -100,6 +120,7 @@ export const ShortCompileTimeoutErrorState = () => {
|
||||
source="compile-timeout"
|
||||
buttonProps={{ variant: 'premium', size: 'sm' }}
|
||||
segmentation={segmentation}
|
||||
extraSearchParams={extraSearchParams}
|
||||
>
|
||||
{t('start_a_free_trial')}
|
||||
</StartFreeTrialButton>
|
||||
|
||||
@@ -5,7 +5,7 @@ import { isSplitTestEnabled, getSplitTestVariant } from '@/utils/splitTestUtils'
|
||||
// TODO: change this when we have a launch date
|
||||
const NEW_USER_CUTOFF_DATE = new Date('2100-01-01')
|
||||
|
||||
const isNewUser = () => {
|
||||
export const isNewUser = () => {
|
||||
const user = getMeta('ol-user')
|
||||
|
||||
if (!user.signUpDate) return false
|
||||
|
||||
+22
-1
@@ -11,7 +11,11 @@ import {
|
||||
populateEditorRedesignSegmentation,
|
||||
useEditorAnalytics,
|
||||
} from '@/shared/hooks/use-editor-analytics'
|
||||
import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
|
||||
import {
|
||||
isNewUser,
|
||||
useIsNewEditorEnabled,
|
||||
} from '@/features/ide-redesign/utils/new-editor-utils'
|
||||
import { getSplitTestVariant } from '@/utils/splitTestUtils'
|
||||
|
||||
function TimeoutUpgradePromptNew() {
|
||||
const {
|
||||
@@ -75,6 +79,22 @@ const CompileTimeout = memo(function CompileTimeout({
|
||||
}: CompileTimeoutProps) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const extraSearchParams = useMemo(() => {
|
||||
if (!isNewUser()) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
const variant = getSplitTestVariant('editor-redesign-new-users')
|
||||
|
||||
if (!variant) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
return {
|
||||
itm_content: variant,
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<PdfLogEntry
|
||||
autoExpand
|
||||
@@ -110,6 +130,7 @@ const CompileTimeout = memo(function CompileTimeout({
|
||||
source="compile-timeout"
|
||||
buttonProps={{ variant: 'primary', className: 'w-100' }}
|
||||
segmentation={segmentation}
|
||||
extraSearchParams={extraSearchParams}
|
||||
>
|
||||
{t('start_a_free_trial')}
|
||||
</StartFreeTrialButton>
|
||||
|
||||
@@ -3,7 +3,8 @@ import * as eventTracking from '../infrastructure/event-tracking'
|
||||
export function startFreeTrial(
|
||||
source: string,
|
||||
variant?: string,
|
||||
segmentation?: eventTracking.Segmentation
|
||||
segmentation?: eventTracking.Segmentation,
|
||||
extraSearchParams?: Record<string, string>
|
||||
) {
|
||||
const eventSegmentation: Record<string, string> = {
|
||||
'paywall-type': source,
|
||||
@@ -18,6 +19,7 @@ export function startFreeTrial(
|
||||
|
||||
const searchParams = new URLSearchParams({
|
||||
itm_campaign: source,
|
||||
...extraSearchParams,
|
||||
})
|
||||
|
||||
window.open(`/user/subscription/choose-your-plan?${searchParams.toString()}`)
|
||||
|
||||
@@ -11,6 +11,7 @@ type StartFreeTrialButtonProps = {
|
||||
children?: React.ReactNode
|
||||
handleClick?: React.ComponentProps<typeof OLButton>['onClick']
|
||||
segmentation?: eventTracking.Segmentation
|
||||
extraSearchParams?: Record<string, string>
|
||||
}
|
||||
|
||||
export default function StartFreeTrialButton({
|
||||
@@ -22,6 +23,7 @@ export default function StartFreeTrialButton({
|
||||
source,
|
||||
variant,
|
||||
segmentation,
|
||||
extraSearchParams,
|
||||
}: StartFreeTrialButtonProps) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
@@ -44,9 +46,9 @@ export default function StartFreeTrialButton({
|
||||
handleClick(event)
|
||||
}
|
||||
|
||||
startFreeTrial(source, variant, segmentation)
|
||||
startFreeTrial(source, variant, segmentation, extraSearchParams)
|
||||
},
|
||||
[handleClick, source, variant, segmentation]
|
||||
[handleClick, source, variant, segmentation, extraSearchParams]
|
||||
)
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user