From 2b13fde2922a4d0f6209bfb421b06aff6a5af36d Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Mon, 16 Feb 2026 15:55:21 +0530 Subject: [PATCH 1/2] chore: Update promo URL --- src/lib/util/promos/NewYear2026.svelte | 65 ++++++-------------------- 1 file changed, 13 insertions(+), 52 deletions(-) diff --git a/src/lib/util/promos/NewYear2026.svelte b/src/lib/util/promos/NewYear2026.svelte index 0b6a947c..de654d02 100644 --- a/src/lib/util/promos/NewYear2026.svelte +++ b/src/lib/util/promos/NewYear2026.svelte @@ -9,68 +9,29 @@ let { closeBanner }: Props = $props(); - interface VariantConfig { - bannerCopy: string; - buttonCopy: string; - campaign: 'variant_a' | 'variant_b' | 'variant_c'; - } + const utmSource = env.domain === 'mermaid.ai' ? 'mermaid_ai_live' : 'mermaid_live_editor'; - const variants: VariantConfig[] = [ - { - bannerCopy: 'Use code NEWYEAR for 10% off Mermaid Advanced Editor (limited time)', - buttonCopy: 'Try now', - campaign: 'variant_a' - }, - { - bannerCopy: 'Limited time: 10% off Mermaid Advanced Editor with code NEWYEAR', - buttonCopy: 'Claim discount', - campaign: 'variant_b' - }, - { - bannerCopy: 'Try Mermaid Advanced Editor — get 10% off with code NEWYEAR', - buttonCopy: 'Get started', - campaign: 'variant_c' - } - ]; - - // Determine UTM source based on deployment domain - const getUtmSource = (): string => { - const domain = env.domain; - if (domain === 'mermaid.ai') { - return 'mermaid_ai_live'; - } - return 'mermaid_live_editor'; - }; - - // Randomly select a variant on component mount - const getRandomVariant = (): VariantConfig => { - const index = Math.floor(Math.random() * variants.length); - return variants[index]; - }; - - const selectedVariant = getRandomVariant(); - const utmSource = getUtmSource(); - - const buildUrl = (variant: VariantConfig): string => { - const params = new URLSearchParams({ - utm_medium: 'banner_ad', - utm_campaign: variant.campaign, - utm_source: utmSource - }); - return `https://mermaid.ai/?${params.toString()}`; - }; + const url = `https://mermaid.ai/app/user/billing/checkout?${new URLSearchParams({ + coupon: 'NEWYEAR', + tier: 'plus', + utm_campaign: 'newyear', + utm_medium: 'banner_ad', + utm_source: utmSource + }).toString()}`;