Website: Remove segment and related code. (#33738)

Closes: #33723

Changes:
- Removed the segment analytics tag and all related code.
- Removed the `analytics` global from the .eslintrc in the
website/assets/ folder
This commit is contained in:
Eric 2025-10-01 19:53:12 -05:00 committed by GitHub
parent 88d00435cf
commit c36351490a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 3 additions and 77 deletions

View file

@ -49,7 +49,6 @@
"docsearch": true,
"Chart": true,
"gtag": true,
"analytics": true,
"ace": true,
// ...etc.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View file

@ -91,9 +91,6 @@ parasails.registerPage('contact', {
if(typeof window.lintrk !== 'undefined') {
window.lintrk('track', { conversion_id: 18587089 });// eslint-disable-line camelcase
}
if(typeof analytics !== 'undefined'){
analytics.track('fleet_website__contact_forms');
}
// Show the success message.
this.cloudSuccess = true;
@ -106,9 +103,6 @@ parasails.registerPage('contact', {
if(typeof window.lintrk !== 'undefined') {
window.lintrk('track', { conversion_id: 18587089 });// eslint-disable-line camelcase
}
if(typeof analytics !== 'undefined'){
analytics.track('fleet_website__contact_forms');
}
let eventUrl = await Cloud.deliverTalkToUsFormSubmission.with(argins);
this.goto(eventUrl);

View file

@ -44,28 +44,6 @@ parasails.registerPage('new-license', {
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
beforeMount: function() {
if(window.location.hash) {
if(window.analytics !== undefined) {
if(window.location.hash === '#signup') {
analytics.identify(this.me.id, {
email: this.me.emailAddress,
firstName: this.me.firstName,
lastName: this.me.lastName,
company: this.me.organization,
primaryBuyingSituation: this.me.primaryBuyingSituation,
psychologicalStage: this.me.psychologicalStage,
});
analytics.track('fleet_website__sign_up');
} else if(window.location.hash === '#login') {
analytics.identify(this.me.id, {
email: this.me.emailAddress,
firstName: this.me.firstName,
lastName: this.me.lastName,
company: this.me.organization,
primaryBuyingSituation: this.me.primaryBuyingSituation,
psychologicalStage: this.me.psychologicalStage,
});
}
}
window.location.hash = '';
}
},

View file

@ -57,9 +57,6 @@ parasails.registerPage('device-management-page', {
if(window.lintrk !== undefined) {
window.lintrk('track', { conversion_id: 18587105 });// eslint-disable-line camelcase
}
if(window.analytics !== undefined) {
analytics.track('fleet_website__swag_request');
}
this.goto('https://kqphpqst851.typeform.com/to/ZfA3sOu0#from_page=device-managment');
},
}

View file

@ -204,9 +204,6 @@ parasails.registerPage('basic-documentation', {
if(window.lintrk !== undefined) {
window.lintrk('track', { conversion_id: 18587105 });// eslint-disable-line camelcase
}
if(window.analytics !== undefined) {
analytics.track('fleet_website__swag_request');
}
this.goto('https://kqphpqst851.typeform.com/to/ZfA3sOu0#from_page=docs');
},

View file

@ -42,7 +42,7 @@ parasails.registerPage('login', {
// If we're redirecting this user to the license dispenser after they log in, modify the link to the /register page and the pageToRedirectToAfterLogin.
if(window.location.hash === '#purchaseLicense'){
this.registerSlug = '/register#purchaseLicense';
this.pageToRedirectToAfterLogin = '/new-license#login';
this.pageToRedirectToAfterLogin = '/new-license';
window.location.hash = '';
// If we're redirecting this user to the contact form after they log in, modify the link to the /register page and the pageToRedirectToAfterLogin.
} else if(window.location.hash === '#contact'){

View file

@ -39,7 +39,7 @@ parasails.registerPage('signup', {
if(window.location.hash === '#purchaseLicense'){
this.loginSlug = '/login#purchaseLicense';
this.pageToRedirectToAfterRegistration = '/new-license#signup';
this.pageToRedirectToAfterRegistration = '/new-license';
window.location.hash = '';
} else if(window.location.hash === '#tryfleet') {
this.loginSlug = '/login#tryfleet';
@ -72,7 +72,7 @@ parasails.registerPage('signup', {
},
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.)
// Track a "key event" in Google Analytics.
// > Naming convention: (like sails config)
// > "Website - Sign up" becomes "fleet_website__sign_up" (double-underscore representing hierarchy)
if(window.gtag !== undefined){

View file

@ -97,28 +97,6 @@ parasails.registerPage('start', {
this.psychologicalStage = this.me.psychologicalStage;
}
if(window.location.hash) {
if(window.analytics !== undefined) {
if(window.location.hash === '#signup') {
analytics.identify(this.me.id, {
email: this.me.emailAddress,
firstName: this.me.firstName,
lastName: this.me.lastName,
company: this.me.organization,
primaryBuyingSituation: this.me.primaryBuyingSituation,
psychologicalStage: this.me.psychologicalStage,
});
analytics.track('fleet_website__sign_up');
} else if(window.location.hash === '#login') {
analytics.identify(this.me.id, {
email: this.me.emailAddress,
firstName: this.me.firstName,
lastName: this.me.lastName,
company: this.me.organization,
primaryBuyingSituation: this.me.primaryBuyingSituation,
psychologicalStage: this.me.psychologicalStage,
});
}
}
window.location.hash = '';
}
},
@ -141,16 +119,6 @@ parasails.registerPage('start', {
this.previouslyAnsweredQuestions[this.currentStep] = questionanireProgress.getStartedProgress[this.currentStep];
this.psychologicalStage = questionanireProgress.psychologicalStage;
this.primaryBuyingSituation = questionanireProgress.primaryBuyingSituation;
if(typeof analytics !== 'undefined') {
analytics.identify(this.me.id, {
email: this.me.emailAddress,
firstName: this.me.firstName,
lastName: this.me.lastName,
company: this.me.organization,
primaryBuyingSituation: this.primaryBuyingSituation,
psychologicalStage: this.psychologicalStage,
});
}
if(_.startsWith(nextStep, '/')){
this.goto(nextStep);
} else {

View file

@ -65,13 +65,6 @@
<script>
window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-JC3DRNY1GV');
</script>
<%/* Segment */%>
<script>
!function(){var i="analytics",analytics=window[i]=window[i]||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","screen","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware","register"];analytics.factory=function(e){return function(){if(window[i].initialized)return window[i][e].apply(window[i],arguments);var n=Array.prototype.slice.call(arguments);if(["track","screen","alias","group","page","identify"].indexOf(e)>-1){var c=document.querySelector("link[rel='canonical']");n.push({__t:"bpc",c:c&&c.getAttribute("href")||void 0,p:location.pathname,u:location.href,s:location.search,t:document.title,r:document.referrer})}n.unshift(e);analytics.push(n);return analytics}};for(var n=0;n<analytics.methods.length;n++){var key=analytics.methods[n];analytics[key]=analytics.factory(key)}analytics.load=function(key,n){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.setAttribute("data-global-segment-analytics-key",i);t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(t,r);analytics._loadOptions=n};analytics._writeKey="T79nqv6Ow6Bjov5LZPxXqsuhM0YOHARv";;analytics.SNIPPET_VERSION="5.2.0";
analytics.load("T79nqv6Ow6Bjov5LZPxXqsuhM0YOHARv");
analytics.page();
}}();
</script>
<%/* LinkedIn insight tag*/%>
<script type="text/javascript">
_linkedin_partner_id = "4365817";