Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(marketing): offer Google Play on the mobile signup confirmation (#9387)
Peter Chinman091298d4c39b
diff --git a/apps/marketing/src/app/routes/RouteMobileSignupSent.tsx b/apps/marketing/src/app/routes/RouteMobileSignupSent.tsxindex 1deae956f7..2e69237ada 100644--- a/apps/marketing/src/app/routes/RouteMobileSignupSent.tsx+++ b/apps/marketing/src/app/routes/RouteMobileSignupSent.tsx@@ -4,20 +4,31 @@ import { MobileSignupMark } from '../components/graphics/MobileSignupMark';import { analytics } from '../utils/utilAnalytic';import {conversionAlreadyFired,- isIOS,MOBILE_WEB_SIGNUP_LEAD_VALUE,+ type MobileStorePlatform,markConversionFired,+ mobileStorePlatform,submittedEmail,} from '../utils/utilMobileSignup';import { setPageSeo } from '../utils/utilSeo';import './RouteMobileSignup.css';-const APP_STORE_URL = 'https://apps.apple.com/us/app/macro-app/id6743133649';+const STORES: Record<MobileStorePlatform, { url: string; buttonName: string }> =+ {+ ios: {+ url: 'https://apps.apple.com/us/app/macro-app/id6743133649',+ buttonName: 'mobile_signup_sent_app_store',+ },+ android: {+ url: 'https://play.google.com/store/apps/details?id=com.macro.workspace.mobile',+ buttonName: 'mobile_signup_sent_google_play',+ },+ };/*** Confirmation step of the site's mobile email capture: the visitor has been- * emailed a link to finish signing up on a computer. iOS visitors are also- * offered the App Store app; there is no Android app.+ * emailed a link to finish signing up on a computer. iOS and Android visitors+ * are also offered the app from their store.** This page also owns the ad-platform conversions for the captured lead (Meta* Lead + CompleteRegistration, Google Ads `mobile_web_lead`) — they used to@@ -40,10 +51,12 @@ export const RouteMobileSignupSent: Component = () => {const email = (): string | null => location.state?.email ?? submittedEmail();// Hidden in the prerendered page; only the browser knows the platform.- const [showAppStore, setShowAppStore] = createSignal(false);+ const [store, setStore] = createSignal<MobileStorePlatform>();onMount(() => {- setShowAppStore(isIOS(navigator.userAgent, navigator.maxTouchPoints));+ setStore(+ mobileStorePlatform(navigator.userAgent, navigator.maxTouchPoints)+ );// The email field can stay focused across this route change — force the// keyboard down even if blur-before-navigate was skipped somehow.@@ -97,23 +110,25 @@ export const RouteMobileSignupSent: Component = () => {)}</Show></p>- <Show when={showAppStore()}>- <div class="mobile-signup-card-body">- <a- href={APP_STORE_URL}- class="mobile-signup-card-pill"- target="_blank"- rel="noreferrer"- onClick={() => {- analytics.track('app_redirect', {- page_location: window.location.href,- button_name: 'mobile_signup_sent_app_store',- });- }}- >- Download our mobile app- </a>- </div>+ <Show when={store()}>+ {(platform) => (+ <div class="mobile-signup-card-body">+ <a+ href={STORES[platform()].url}+ class="mobile-signup-card-pill"+ target="_blank"+ rel="noreferrer"+ onClick={() => {+ analytics.track('app_redirect', {+ page_location: window.location.href,+ button_name: STORES[platform()].buttonName,+ });+ }}+ >+ Download our mobile app+ </a>+ </div>+ )}</Show></section>);diff --git a/apps/marketing/src/app/utils/utilMobileSignup.test.ts b/apps/marketing/src/app/utils/utilMobileSignup.test.tsindex dfa3779967..639a9697aa 100644--- a/apps/marketing/src/app/utils/utilMobileSignup.test.ts+++ b/apps/marketing/src/app/utils/utilMobileSignup.test.ts@@ -1,5 +1,5 @@import { beforeEach, describe, expect, it, vi } from 'vitest';-import { isIOS } from './utilMobileSignup';+import { mobileStorePlatform } from './utilMobileSignup';const analytics = vi.hoisted(() => ({order: [] as string[],@@ -18,15 +18,16 @@ vi.mock('./utilAnalytic', () => ({},}));-describe('isIOS', () => {+describe('mobileStorePlatform', () => {it.each([- ['Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)', 5, true],- ['Mozilla/5.0 (iPad; CPU OS 17_0 like Mac OS X)', 5, true],- ['Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)', 5, true],- ['Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)', 0, false],- ['Mozilla/5.0 (Linux; Android 14; Pixel 8)', 5, false],+ ['Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)', 5, 'ios'],+ ['Mozilla/5.0 (iPad; CPU OS 17_0 like Mac OS X)', 5, 'ios'],+ ['Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)', 5, 'ios'],+ ['Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)', 0, undefined],+ ['Mozilla/5.0 (Linux; Android 14; Pixel 8)', 5, 'android'],+ ['Mozilla/5.0 (X11; Linux x86_64)', 0, undefined],])('%s with %i touch points → %s', (userAgent, maxTouchPoints, expected) => {- expect(isIOS(userAgent, maxTouchPoints)).toBe(expected);+ expect(mobileStorePlatform(userAgent, maxTouchPoints)).toBe(expected);});});diff --git a/apps/marketing/src/app/utils/utilMobileSignup.ts b/apps/marketing/src/app/utils/utilMobileSignup.tsindex 87b19451c8..ab28c4d24a 100644--- a/apps/marketing/src/app/utils/utilMobileSignup.ts+++ b/apps/marketing/src/app/utils/utilMobileSignup.ts@@ -27,13 +27,25 @@ export const MOBILE_SIGNUP_SENT_PATH = '/mobile-signup-sent';*/export const MOBILE_WEB_SIGNUP_LEAD_VALUE = 5;+export type MobileStorePlatform = 'ios' | 'android';+/**- * True on iPhone, iPod, and iPad — the only phones with a Macro app. iPadOS- * Safari reports itself as a Mac, so a touch-capable "Macintosh" counts too.+ * The app store a visitor's device installs Macro from, or undefined on a+ * computer. iPadOS Safari reports itself as a Mac, so a touch-capable+ * "Macintosh" counts as iOS.*/-export const isIOS = (userAgent: string, maxTouchPoints: number): boolean =>- /iPhone|iPad|iPod/.test(userAgent) ||- (/Macintosh/.test(userAgent) && maxTouchPoints > 1);+export const mobileStorePlatform = (+ userAgent: string,+ maxTouchPoints: number+): MobileStorePlatform | undefined => {+ if (+ /iPhone|iPad|iPod/.test(userAgent) ||+ (/Macintosh/.test(userAgent) && maxTouchPoints > 1)+ )+ return 'ios';+ if (/Android/.test(userAgent)) return 'android';+ return undefined;+};// Survives the navigation from the capture step to the confirmation step (and a// refresh of it), which is where the conversions fire.