diff --git a/packages/manager/apps/web/client/app/domain/contact/contact.constants.js b/packages/manager/apps/web/client/app/domain/contact/contact.constants.js index 3f8c85d7db49..f57de11817e7 100644 --- a/packages/manager/apps/web/client/app/domain/contact/contact.constants.js +++ b/packages/manager/apps/web/client/app/domain/contact/contact.constants.js @@ -195,20 +195,31 @@ const TRACKING_PREFIX = 'web::domain::domain-name::'; const TRACKING_CATEGORY_AND_THEME = { page_category: 'dashboard', page_theme: 'Domains', - page: { name: TRACKING_PREFIX }, }; +const TRACKING_CONTACT_MANAGEMENT_SUFFIX = + 'domain-name::dashboard::contact-management'; + export const CONTACT_MANAGEMENT_TRACKING = { PAGE: { name: `${TRACKING_PREFIX}domain-name::dashboard::contact-management`, + page: { + name: `${TRACKING_PREFIX}${TRACKING_CONTACT_MANAGEMENT_SUFFIX}`, + }, ...TRACKING_CATEGORY_AND_THEME, }, REASSIGN_CONTACT: { name: `${TRACKING_PREFIX}page::button::reset_domain-name-contacts`, + page: { + name: `${TRACKING_PREFIX}${TRACKING_CONTACT_MANAGEMENT_SUFFIX}`, + }, ...TRACKING_CATEGORY_AND_THEME, }, EDIT_CONTACT: { name: `${TRACKING_PREFIX}tile::button::edit_{{contactType}}-contact`, + page: { + name: `${TRACKING_PREFIX}${TRACKING_CONTACT_MANAGEMENT_SUFFIX}`, + }, ...TRACKING_CATEGORY_AND_THEME, }, }; diff --git a/packages/manager/apps/web/client/app/domain/contact/edit/edit.constants.js b/packages/manager/apps/web/client/app/domain/contact/edit/edit.constants.js index 39fdd2cf165c..f92896d611f1 100644 --- a/packages/manager/apps/web/client/app/domain/contact/edit/edit.constants.js +++ b/packages/manager/apps/web/client/app/domain/contact/edit/edit.constants.js @@ -115,28 +115,45 @@ const TRACKING_PREFIX = 'web::domain::domain-name::'; const TRACKING_CATEGORY_AND_THEME = { page_category: 'funnel', page_theme: 'Domains', - page: { name: TRACKING_PREFIX }, }; +const TRACKING_EDIT_HOLDER_SUFFIX = 'domain-name::funnel::edit_holder-contact'; + export const CONTACT_MANAGEMENT_EDIT_TRACKING = { PAGE: { name: `${TRACKING_PREFIX}domain-name::funnel::edit_holder-contact`, + page: { + name: `${TRACKING_PREFIX}${TRACKING_EDIT_HOLDER_SUFFIX}`, + }, ...TRACKING_CATEGORY_AND_THEME, }, BANNER: { - name: `${TRACKING_PREFIX}domain-name::funnel::edit_holder-contact::banner-{{bannerType}}::edit-holder-contact_{{bannerType}}`, + name: `${TRACKING_PREFIX}domain-name::banner-{{bannerType}}::edit-holder-contact_{{returnType}}`, + page: { + name: `${TRACKING_PREFIX}domain-name::banner-{{bannerType}}::edit-holder-contact_{{returnType}}`, + }, ...TRACKING_CATEGORY_AND_THEME, + page_category: 'banner', }, SUBMIT: { name: `${TRACKING_PREFIX}funnel::button::edit_holder-contact_confirm`, + page: { + name: `${TRACKING_PREFIX}${TRACKING_EDIT_HOLDER_SUFFIX}`, + }, ...TRACKING_CATEGORY_AND_THEME, }, CANCEL: { name: `${TRACKING_PREFIX}funnel::button::edit_holder-contact_cancel`, + page: { + name: `${TRACKING_PREFIX}${TRACKING_EDIT_HOLDER_SUFFIX}`, + }, ...TRACKING_CATEGORY_AND_THEME, }, LINK: { name: `${TRACKING_PREFIX}funnel::link::edit_holder_next`, + page: { + name: `${TRACKING_PREFIX}domain-name::funnel::edit_holder-contact`, + }, ...TRACKING_CATEGORY_AND_THEME, }, }; diff --git a/packages/manager/apps/web/client/app/domain/contact/edit/edit.controller.js b/packages/manager/apps/web/client/app/domain/contact/edit/edit.controller.js index ccc869958d0b..6b59863a84a8 100644 --- a/packages/manager/apps/web/client/app/domain/contact/edit/edit.controller.js +++ b/packages/manager/apps/web/client/app/domain/contact/edit/edit.controller.js @@ -246,9 +246,15 @@ export default class DomainContactEditCtrl { this.atInternet.trackPage({ ...CONTACT_MANAGEMENT_EDIT_TRACKING.BANNER, name: CONTACT_MANAGEMENT_EDIT_TRACKING.BANNER.name.replace( - /{{bannerType}}/g, + /{{bannerType}}|{{returnType}}/g, 'error', ), + page: { + name: CONTACT_MANAGEMENT_EDIT_TRACKING.BANNER.page.name.replace( + /{{bannerType}}|{{returnType}}/g, + 'error', + ), + }, }); } } diff --git a/packages/manager/apps/web/client/app/domain/contact/edit/edit.routing.js b/packages/manager/apps/web/client/app/domain/contact/edit/edit.routing.js index 26f37dee741c..3e235b0727cf 100644 --- a/packages/manager/apps/web/client/app/domain/contact/edit/edit.routing.js +++ b/packages/manager/apps/web/client/app/domain/contact/edit/edit.routing.js @@ -26,15 +26,27 @@ export default /* @ngInject */ ($stateProvider) => { }); if (message) { + const replaceValue = { + '{{bannerType}}_success': 'info', + '{{returnType}}_success': 'success', + '{{bannerType}}_error': 'error', + '{{returnType}}_error': 'error', + }; promise.then(() => $timeout(() => { Alerter[type](message, 'dashboardContact'); atInternet.trackPage({ ...CONTACT_MANAGEMENT_EDIT_TRACKING.BANNER, name: CONTACT_MANAGEMENT_EDIT_TRACKING.BANNER.name.replace( - /{{bannerType}}/g, - type, + /{{bannerType}}|{{returnType}}/g, + (match) => replaceValue[`${match}_${type}`], ), + page: { + name: CONTACT_MANAGEMENT_EDIT_TRACKING.BANNER.page.name.replace( + /{{bannerType}}|{{returnType}}/g, + (match) => replaceValue[`${match}_${type}`], + ), + }, }); }, 1000), );