Skip to content

Commit 3dd2a80

Browse files
mikermcneileashaw
andauthored
Add some comments and get eric started (#23666)
Co-authored-by: Eric <[email protected]>
1 parent 6e03272 commit 3dd2a80

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

website/assets/js/pages/customers/new-license.page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ parasails.registerPage('new-license', {
4040
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
4141
beforeMount: function() {
4242
if(window.location.hash) {
43-
if(typeof analytics !== 'undefined') {
43+
if(window.analytics !== undefined) {
4444
if(window.location.hash === '#signup') {
4545
analytics.identify(this.me.id, {
4646
email: this.me.emailAddress,

website/assets/js/pages/device-management.page.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ parasails.registerPage('device-management-page', {
3131
this.modal = undefined;
3232
},
3333
clickSwagRequestCTA: function () {
34-
if(typeof gtag !== 'undefined') {
34+
if(window.gtag !== undefined){
3535
gtag('event','fleet_website__swag_request');
3636
}
37-
if(typeof window.lintrk !== 'undefined') {
37+
if(window.lintrk !== undefined) {
3838
window.lintrk('track', { conversion_id: 18587105 });// eslint-disable-line camelcase
3939
}
40-
if(typeof analytics !== 'undefined'){
40+
if(window.analytics !== undefined) {
4141
analytics.track('fleet_website__swag_request');
4242
}
4343
this.goto('https://kqphpqst851.typeform.com/to/ZfA3sOu0#from_page=device-managment');

website/assets/js/pages/docs/basic-documentation.page.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ parasails.registerPage('basic-documentation', {
221221
methods: {
222222

223223
clickSwagRequestCTA: function () {
224-
if(typeof gtag !== 'undefined') {
224+
if(window.gtag !== undefined){
225225
gtag('event','fleet_website__swag_request');
226226
}
227-
if(typeof window.lintrk !== 'undefined') {
227+
if(window.lintrk !== undefined) {
228228
window.lintrk('track', { conversion_id: 18587105 });// eslint-disable-line camelcase
229229
}
230-
if(typeof analytics !== 'undefined'){
230+
if(window.analytics !== undefined) {
231231
analytics.track('fleet_website__swag_request');
232232
}
233233
this.goto('https://kqphpqst851.typeform.com/to/ZfA3sOu0#from_page=docs');

website/assets/js/pages/entrance/signup.page.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,22 @@ parasails.registerPage('signup', {
6464
}
6565
},
6666

67-
submittedSignUpForm: async function() {
68-
// redirect to the /start page.
69-
// > (Note that we re-enable the syncing state here. This is on purpose--
70-
// > to make sure the spinner stays there until the page navigation finishes.)
71-
//
72-
// Naming convention: (like sails config)
73-
// "Website - Sign up" becomes "fleet_website__sign_up" (double-underscore representing hierarchy)
74-
if(typeof gtag !== 'undefined'){
75-
gtag('event','fleet_website__sign_up');
67+
submittedSignUpForm: async function() {// When the server says everything worked…
68+
// 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.)
69+
// > Naming convention: (like sails config)
70+
// > "Website - Sign up" becomes "fleet_website__sign_up" (double-underscore representing hierarchy)
71+
if(window.gtag !== undefined){
72+
window.gtag('event','fleet_website__sign_up');
7673
}
77-
if(typeof window.lintrk !== 'undefined') {
74+
75+
// Track a "conversion" in LinkedIn Campaign Manager.
76+
if(window.lintrk !== undefined) {
7877
window.lintrk('track', { conversion_id: 18587097 });// eslint-disable-line camelcase
7978
}
79+
80+
// Redirect to the /start page.
81+
// > (Note that we re-enable the syncing state here. This is on purpose--
82+
// > to make sure the spinner stays there until the page navigation finishes.)
8083
this.syncing = true;
8184
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.
8285
}

website/assets/js/pages/start.page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ parasails.registerPage('start', {
9797
this.psychologicalStage = this.me.psychologicalStage;
9898
}
9999
if(window.location.hash) {
100-
if(typeof analytics !== 'undefined') {
100+
if(window.analytics !== undefined) {
101101
if(window.location.hash === '#signup') {
102102
analytics.identify(this.me.id, {
103103
email: this.me.emailAddress,

0 commit comments

Comments
 (0)