Skip to content

Commit

Permalink
fix(web.domain): fix tracking page name for contact management
Browse files Browse the repository at this point in the history
ref: MANAGER-15859

Signed-off-by: Guillaume Hyenne <[email protected]>
  • Loading branch information
ghyenne committed Jan 10, 2025
1 parent 568652d commit c107f48
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
},
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
Expand Down

0 comments on commit c107f48

Please sign in to comment.