From ec47baea6f3b3050e07688bf3e65f6920cb277a7 Mon Sep 17 00:00:00 2001 From: FrankRua Date: Thu, 21 Apr 2022 11:47:34 -0400 Subject: [PATCH 1/4] include vue.config.release --- vue.release.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vue.release.config.js b/vue.release.config.js index 86563f59e..bb6a6194e 100644 --- a/vue.release.config.js +++ b/vue.release.config.js @@ -2,6 +2,10 @@ process.env.VUE_APP_CONSUMER_API_GATEWAY = "__VUE_APP_CONSUMER_API_GATEWAY__"; process.env.VUE_APP_GOOGLE_PLACES_API_KEY = "__VUE_APP_GOOGLE_PLACES_API_KEY__"; process.env.VUE_APP_HERITAGE_FUNNEL = "__VUE_APP_HERITAGE_FUNNEL__"; +// GA & GTM +process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__"; +process.env.VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC = "__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__" + module.exports = { outputDir: "dist/fmg", publicPath: "/fmg", From 80ef6b85ddb25dc103cb7ed41d03a0c995dbe214 Mon Sep 17 00:00:00 2001 From: FrankRua Date: Thu, 21 Apr 2022 13:28:17 -0400 Subject: [PATCH 2/4] GA event methods --- src/mixins/base-mixin.js | 41 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index b5a954c43..757583999 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -11,10 +11,10 @@ export default { }; }, methods: { - setCmsContent(cmsContent){ + setCmsContent(cmsContent) { this.$root.cmsContentByWidget = cmsContent; }, - getCmsContent(widgetName, fieldName){ + getCmsContent(widgetName, fieldName) { return this.$root.cmsContentByWidget?.[widgetName]?.[fieldName] ? this.$root.cmsContentByWidget[widgetName][fieldName] : ''; }, dispatchNonBlockingStoreAction(type, payload, encodePayload = true) { @@ -25,10 +25,10 @@ export default { return store.dispatch(type, payload); }, - savePageDataToStore(page, data){ + savePageDataToStore(page, data) { store.commit(storeMutations.UPDATE_PAGE_DATA, { page: page, data: data }); }, - onSubmit() {}, // DO NOT REMOVE; needed to prevent default form submit behavior + onSubmit() { }, // DO NOT REMOVE; needed to prevent default form submit behavior onInvalidSubmit({ values, errors, results }) { // identify the first error field and put focus on it // get error names array @@ -40,6 +40,28 @@ export default { el && el.focus(); } }, + + pushEventToGA(category, action, label, value) { + const eventToBePushed = { + 'event': 'ga_event', + 'category': category, + 'action': action, + 'label': label, + 'value': value, + 'path': '/fmg/' + getQueryStringValue('fmgPage') + } + pushToDataLayerIfDefined(eventToBePushed); + }, + + pushPageViewToGA() { + const pageViewEvent = { + 'event': 'logPageview', + 'pagePath': '/fmg/' + getQueryStringValue('fmgPage'), + 'pageTitle': getQueryStringValue('fmgPage') + }; + pushToDataLayerIfDefined(pageViewEvent); + } + }, computed: { storeActions() { @@ -65,3 +87,14 @@ function encodeUriData(payload) { }); } } + +function getQueryStringValue(key) { + var queryStrings = new URLSearchParams(location.search); + return queryStrings.get(key); +} + +function pushToDataLayerIfDefined(data) { + if (window.dataLayer !== undefined) { + window.dataLayer.push(data); + } +} From 723ad593350d1a411dbd37f594af19d517e188ae Mon Sep 17 00:00:00 2001 From: FrankRua Date: Thu, 21 Apr 2022 14:05:35 -0400 Subject: [PATCH 3/4] Test page views --- src/mixins/base-mixin.js | 16 ++++++---------- src/router/index.js | 5 +++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 757583999..11947f26a 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -3,6 +3,7 @@ import { storeActions } from "@/constants/store-actions.js"; import { storeMutations } from "@/constants/store-mutations.js"; import { navigationScenarios } from "@/router/router-constants/navigation-scenarios"; import { vehicleCategories } from "@/constants/vehicle-categories.js"; +import { queryStrings } from "@/constants/query-strings"; export default { data() { @@ -41,23 +42,23 @@ export default { } }, - pushEventToGA(category, action, label, value) { + pushEventToGA(category, action, label, value, pageName) { const eventToBePushed = { 'event': 'ga_event', 'category': category, 'action': action, 'label': label, 'value': value, - 'path': '/fmg/' + getQueryStringValue('fmgPage') + 'path': `/fmg/?${queryStrings.FMG_PAGE}=${pageName}` } pushToDataLayerIfDefined(eventToBePushed); }, - pushPageViewToGA() { + pushPageViewToGA(pageName) { const pageViewEvent = { 'event': 'logPageview', - 'pagePath': '/fmg/' + getQueryStringValue('fmgPage'), - 'pageTitle': getQueryStringValue('fmgPage') + 'pagePath': `/fmg/?${queryStrings.FMG_PAGE}=${pageName}`, + 'pageTitle': pageName }; pushToDataLayerIfDefined(pageViewEvent); } @@ -88,11 +89,6 @@ function encodeUriData(payload) { } } -function getQueryStringValue(key) { - var queryStrings = new URLSearchParams(location.search); - return queryStrings.get(key); -} - function pushToDataLayerIfDefined(data) { if (window.dataLayer !== undefined) { window.dataLayer.push(data); diff --git a/src/router/index.js b/src/router/index.js index ace5b43cc..54c0bfac2 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -4,6 +4,7 @@ import { storeActions } from "@/constants/store-actions"; import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js"; import { routingTable } from "@/router/router-constants/routing-table.js"; import { globalEvents, globalEventTypes } from "@/constants/events"; +import { queryStrings } from "@/constants/query-strings"; // Heritage integration import { isSavedSessionStillActive } from "@/helpers/heritage-integration/session-helper"; @@ -120,6 +121,10 @@ const router = createRouter({ //---------------------------------------------------------- Router Functions ---------------------------------------------------------- +router.afterEach((to, from) => { + baseMixin.methods.pushPageViewToGA(to.query[queryStrings.FMG_PAGE]); +}); + router.navigate = (scenario, currentRoute, optionalQuery = {}, optionalParams = {}, optionalPageData = {}) => { navigate(scenario, currentRoute, false, optionalQuery, optionalParams, optionalPageData); } From 32fc80bbadb5a00faacaf8fca02e1749d4f1912f Mon Sep 17 00:00:00 2001 From: bmauger Date: Thu, 21 Apr 2022 16:59:17 -0400 Subject: [PATCH 4/4] Update border color for input (validation). --- src/styles/common-error-styles.scss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/styles/common-error-styles.scss b/src/styles/common-error-styles.scss index f99dc4751..165101177 100644 --- a/src/styles/common-error-styles.scss +++ b/src/styles/common-error-styles.scss @@ -73,6 +73,18 @@ html { border-radius: .5rem; } } + input:checked:focus { + + label { + box-shadow: 0 0 0 1px $blue; + border-radius: .5rem; + } + } + input:checked:not(:focus) { + + label { + box-shadow: 0 0 0 1px $blue; + border-radius: .5rem; + } + } input:focus { border: 1px solid $gray-500; + label {