diff --git a/website/assets/js/pages/customers/new-license.page.js b/website/assets/js/pages/customers/new-license.page.js index b601c8a80f..e0e7e61654 100644 --- a/website/assets/js/pages/customers/new-license.page.js +++ b/website/assets/js/pages/customers/new-license.page.js @@ -40,7 +40,7 @@ parasails.registerPage('new-license', { // ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝ beforeMount: function() { if(window.location.hash) { - if(typeof analytics !== 'undefined') { + if(window.analytics !== undefined) { if(window.location.hash === '#signup') { analytics.identify(this.me.id, { email: this.me.emailAddress, diff --git a/website/assets/js/pages/device-management.page.js b/website/assets/js/pages/device-management.page.js index cb36f759ba..3dda3f939d 100644 --- a/website/assets/js/pages/device-management.page.js +++ b/website/assets/js/pages/device-management.page.js @@ -31,13 +31,13 @@ parasails.registerPage('device-management-page', { this.modal = undefined; }, clickSwagRequestCTA: function () { - if(typeof gtag !== 'undefined') { + if(window.gtag !== undefined){ gtag('event','fleet_website__swag_request'); } - if(typeof window.lintrk !== 'undefined') { + if(window.lintrk !== undefined) { window.lintrk('track', { conversion_id: 18587105 });// eslint-disable-line camelcase } - if(typeof analytics !== 'undefined'){ + if(window.analytics !== undefined) { analytics.track('fleet_website__swag_request'); } this.goto('https://kqphpqst851.typeform.com/to/ZfA3sOu0#from_page=device-managment'); diff --git a/website/assets/js/pages/docs/basic-documentation.page.js b/website/assets/js/pages/docs/basic-documentation.page.js index c402f57d96..ba111ea84b 100644 --- a/website/assets/js/pages/docs/basic-documentation.page.js +++ b/website/assets/js/pages/docs/basic-documentation.page.js @@ -221,13 +221,13 @@ parasails.registerPage('basic-documentation', { methods: { clickSwagRequestCTA: function () { - if(typeof gtag !== 'undefined') { + if(window.gtag !== undefined){ gtag('event','fleet_website__swag_request'); } - if(typeof window.lintrk !== 'undefined') { + if(window.lintrk !== undefined) { window.lintrk('track', { conversion_id: 18587105 });// eslint-disable-line camelcase } - if(typeof analytics !== 'undefined'){ + if(window.analytics !== undefined) { analytics.track('fleet_website__swag_request'); } this.goto('https://kqphpqst851.typeform.com/to/ZfA3sOu0#from_page=docs'); diff --git a/website/assets/js/pages/entrance/signup.page.js b/website/assets/js/pages/entrance/signup.page.js index d749af7b30..d34b6ed086 100644 --- a/website/assets/js/pages/entrance/signup.page.js +++ b/website/assets/js/pages/entrance/signup.page.js @@ -64,19 +64,22 @@ parasails.registerPage('signup', { } }, - submittedSignUpForm: async function() { - // redirect to the /start page. - // > (Note that we re-enable the syncing state here. This is on purpose-- - // > to make sure the spinner stays there until the page navigation finishes.) - // - // Naming convention: (like sails config) - // "Website - Sign up" becomes "fleet_website__sign_up" (double-underscore representing hierarchy) - if(typeof gtag !== 'undefined'){ - gtag('event','fleet_website__sign_up'); + submittedSignUpForm: async function() {// When the server says everything worked… + // Track a "key event" in Google Analytics. (? but don't we do that when we call analytics.track() [segment] later on in start.page.js? TODO: eric help please – I suspect this one is either duplicate OR it's actually writing to Google Ads, and not to Google Analytics. I'm pretty sure segment's .track() is what writes to google analytics.) + // > Naming convention: (like sails config) + // > "Website - Sign up" becomes "fleet_website__sign_up" (double-underscore representing hierarchy) + if(window.gtag !== undefined){ + window.gtag('event','fleet_website__sign_up'); } - if(typeof window.lintrk !== 'undefined') { + + // Track a "conversion" in LinkedIn Campaign Manager. + if(window.lintrk !== undefined) { window.lintrk('track', { conversion_id: 18587097 });// eslint-disable-line camelcase } + + // Redirect to the /start page. + // > (Note that we re-enable the syncing state here. This is on purpose-- + // > to make sure the spinner stays there until the page navigation finishes.) this.syncing = true; this.goto(this.pageToRedirectToAfterRegistration);// « / start if the user came here from the start now button, or customers/new-license if the user came here from the "Get your license" link. } diff --git a/website/assets/js/pages/start.page.js b/website/assets/js/pages/start.page.js index 3a9992cda5..2f62581ab9 100644 --- a/website/assets/js/pages/start.page.js +++ b/website/assets/js/pages/start.page.js @@ -97,7 +97,7 @@ parasails.registerPage('start', { this.psychologicalStage = this.me.psychologicalStage; } if(window.location.hash) { - if(typeof analytics !== 'undefined') { + if(window.analytics !== undefined) { if(window.location.hash === '#signup') { analytics.identify(this.me.id, { email: this.me.emailAddress,