fix(welcome): pass utm on to welcome

This commit is contained in:
Evan Morikawa 2016-06-08 14:19:15 -07:00
parent 3ed9ca6058
commit 4c0da37b00
2 changed files with 11 additions and 3 deletions

View file

@ -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) {

View file

@ -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});
}