diff --git a/internal_packages/onboarding/lib/onboarding-helpers.es6 b/internal_packages/onboarding/lib/onboarding-helpers.es6 index f03983fc8..091d8b534 100644 --- a/internal_packages/onboarding/lib/onboarding-helpers.es6 +++ b/internal_packages/onboarding/lib/onboarding-helpers.es6 @@ -67,10 +67,18 @@ export function buildGmailAuthURL(sessionKey) { }); } -export function buildWelcomeURL(welcomeRoot) { +export function buildWelcomeURL(welcomeRoot, {source}) { const identityId = IdentityStore.identityId(); if (!identityId) { NylasEnv.reportError(new Error("buildWelcomeURL: Can't find Nylas ID")) } - return `${welcomeRoot}/welcome?n=${base64url(identityId)}` + const query = { + n: base64url(identityId), + utm_medium: "N1", + } + if (source) { query.utm_source = source } + return url.format({ + pathname: `${welcomeRoot}/welcome`, + query: query, + }) } export function runAuthRequest(accountInfo) { diff --git a/internal_packages/onboarding/lib/onboarding-store.es6 b/internal_packages/onboarding/lib/onboarding-store.es6 index b7a8bb260..31d4f1a1f 100644 --- a/internal_packages/onboarding/lib/onboarding-store.es6 +++ b/internal_packages/onboarding/lib/onboarding-store.es6 @@ -77,7 +77,7 @@ class OnboardingStore extends NylasStore { */ _openWelcomePage() { // open the external welcome page - const url = buildWelcomeURL(this.welcomeRoot); + const url = buildWelcomeURL(this.welcomeRoot, {source: "OnboardingStore"}); shell.openExternal(url, {activate: false}); }