mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
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:
parent
88d00435cf
commit
c36351490a
9 changed files with 3 additions and 77 deletions
1
website/assets/.eslintrc
vendored
1
website/assets/.eslintrc
vendored
|
|
@ -49,7 +49,6 @@
|
|||
"docsearch": true,
|
||||
"Chart": true,
|
||||
"gtag": true,
|
||||
"analytics": true,
|
||||
"ace": true,
|
||||
// ...etc.
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
|||
6
website/assets/js/pages/contact.page.js
vendored
6
website/assets/js/pages/contact.page.js
vendored
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 = '';
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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'){
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
32
website/assets/js/pages/start.page.js
vendored
32
website/assets/js/pages/start.page.js
vendored
|
|
@ -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 {
|
||||
|
|
|
|||
7
website/views/layouts/layout.ejs
vendored
7
website/views/layouts/layout.ejs
vendored
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Reference in a new issue