Website: Send analytics events (#19745)

Related to: #19603 

Changes:
- Updated the contact page to send an event (`website_contact_forms`) to
Google Analytics when a user submits the form
- Update the signup page to send an event (`website_sign_up`) to Google
Analytics when a user signs up
- Updated the swag request button in the docs to send an event
(`website_swag_request`) to Google Analytics when a user visits the swag
request typeform.
This commit is contained in:
Eric 2024-06-13 17:07:14 -05:00 committed by GitHub
parent 443564b553
commit bcf3052117
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 18 additions and 3 deletions

View file

@ -48,7 +48,7 @@
"moment": true,
"docsearch": true,
"Chart": true,
// "google": true,
"gtag": true,
// ...etc.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View file

@ -80,13 +80,18 @@ parasails.registerPage('contact', {
methods: {
submittedContactForm: async function() {
if(typeof gtag !== 'undefined'){
gtag('event','website_contact_forms');
}
// Show the success message.
this.cloudSuccess = true;
},
submittedTalkToUsForm: async function() {
this.syncing = true;
if(typeof gtag !== 'undefined'){
gtag('event','website_contact_forms');
}
if(this.formData.numberOfHosts > 700){
this.goto(`https://calendly.com/fleetdm/talk-to-us?email=${encodeURIComponent(this.formData.emailAddress)}&name=${encodeURIComponent(this.formData.firstName+' '+this.formData.lastName)}`);
} else {

View file

@ -222,6 +222,13 @@ parasails.registerPage('basic-documentation', {
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
methods: {
clickSwagRequestCTA: function () {
if(typeof gtag !== 'undefined') {
gtag('event','website_swag_request');
}
this.goto('https://kqphpqst851.typeform.com/to/ZfA3sOu0');
},
clickCTA: function (slug) {
this.goto(slug);
},

View file

@ -67,6 +67,9 @@ parasails.registerPage('signup', {
// 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.)
if(typeof gtag !== 'undefined'){
gtag('event','website_sign_up');
}
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.
}

View file

@ -157,7 +157,7 @@
<a class="pb-3" target="_blank" href="https://github.com/fleetdm/fleet/releases">Releases</a>
<a class="pb-3" target="_blank" href="/support">Support</a>
<div class="d-none d-lg-block" purpose="swag-cta" v-if="showSwagForm">
<a class="d-flex align-items-center justify-content-center" href="https://kqphpqst851.typeform.com/to/ZfA3sOu0" target="_blank">
<a class="d-flex align-items-center justify-content-center" @click="clickSwagRequestCTA()">
<div class="d-flex flex-column align-items-center">
<img style="height: auto; width: 47px; margin-bottom: 8px;" alt="A very nice Fleet branded shirt" src="/images/fleet-shirt-60x55@2x.png">
<p class="mb-0">Request Fleet swag</p>