diff --git a/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/clusters/cluster/dashboard/dashboard.html b/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/clusters/cluster/dashboard/dashboard.html index 60120194168e..b97ff9de7295 100644 --- a/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/clusters/cluster/dashboard/dashboard.html +++ b/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/clusters/cluster/dashboard/dashboard.html @@ -16,7 +16,9 @@ data-on-error="$ctrl.onBillingInformationError(error)" data-service-infos="$ctrl.serviceInfos" data-user="$ctrl.user" - data-tracking-prefix="{{$ctrl.trackingPrefix}}" + data-tracking-page="DedicatedServers::dedicated-server::cluster::cluster::dashboard::general-information" + data-tracking-name-suffix="cluster" + tracking-prefix="DedicatedServers::dedicated-server::cluster" > diff --git a/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/clusters/nodes/node/dashboard/dashboard.routing.js b/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/clusters/nodes/node/dashboard/dashboard.routing.js index ca225cbb5063..e85264c6aeab 100644 --- a/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/clusters/nodes/node/dashboard/dashboard.routing.js +++ b/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/clusters/nodes/node/dashboard/dashboard.routing.js @@ -282,6 +282,11 @@ export default /* @ngInject */ ($stateProvider) => { productId: serverName, }), trackingPrefix: () => 'dedicated::node::dashboard', + trackingSubscriptionPrefix: () => + 'DedicatedServers::dedicated-server::server', + trackingPage: () => + 'DedicatedServers::dedicated-server::server::server::dashboard::general-information', + trackingNameSuffix: () => 'server', trafficInformation: /* @ngInject */ ( $q, $stateParams, diff --git a/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/servers/server/dashboard/dashboard.routing.js b/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/servers/server/dashboard/dashboard.routing.js index a5aa09eb4949..5c231674d063 100644 --- a/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/servers/server/dashboard/dashboard.routing.js +++ b/packages/manager/apps/dedicated/client/app/dedicated/dedicated-server/servers/server/dashboard/dashboard.routing.js @@ -258,6 +258,11 @@ export default /* @ngInject */ ($stateProvider) => { productId: serverName, }), trackingPrefix: () => 'dedicated::server::dashboard', + trackingSubscriptionPrefix: () => + 'DedicatedServers::dedicated-server::node', + trackingPage: () => + 'DedicatedServers::dedicated-server::node::node::dashboard::general-information', + trackingNameSuffix: () => 'node', trafficInformation: /* @ngInject */ ( $q, $stateParams, diff --git a/packages/manager/modules/billing-components/src/components/payment-method/payment-method.component.js b/packages/manager/modules/billing-components/src/components/payment-method/payment-method.component.js index 57384dcb63ed..6e0204c9f2bb 100644 --- a/packages/manager/modules/billing-components/src/components/payment-method/payment-method.component.js +++ b/packages/manager/modules/billing-components/src/components/payment-method/payment-method.component.js @@ -2,7 +2,10 @@ import controller from './payment-method.controller'; import template from './payment-method.html'; export default { - bindings: {}, + bindings: { + trackingPage: '<', + trackingCategory: '<', + }, controller, name: 'ovhManagerAutoRenewPaymentMethod', template, diff --git a/packages/manager/modules/billing-components/src/components/payment-method/payment-method.controller.js b/packages/manager/modules/billing-components/src/components/payment-method/payment-method.controller.js index c1f343f7dc01..314b2fe127fe 100644 --- a/packages/manager/modules/billing-components/src/components/payment-method/payment-method.controller.js +++ b/packages/manager/modules/billing-components/src/components/payment-method/payment-method.controller.js @@ -1,9 +1,10 @@ export default class PaymentMethodController { /* @ngInject */ - constructor($http, coreURLBuilder, $filter) { + constructor($http, coreURLBuilder, $filter, atInternet) { this.$http = $http; this.coreURLBuilder = coreURLBuilder; this.$filter = $filter; + this.atInternet = atInternet; } $onInit() { @@ -35,4 +36,17 @@ export default class PaymentMethodController { '#/billing/payment/method', ); } + + trackPaymentClick() { + this.atInternet.trackClick({ + name: `hub::billing::services::listing::tile::link::${ + this.paymentMehtod ? 'edit' : 'activate' + }_services::autorenew`, + type: 'action', + page_category: this.trackingCategory, + page: { + name: this.trackingPage, + }, + }); + } } diff --git a/packages/manager/modules/billing-components/src/components/payment-method/payment-method.html b/packages/manager/modules/billing-components/src/components/payment-method/payment-method.html index 9e9aa1934649..67a794fa3991 100644 --- a/packages/manager/modules/billing-components/src/components/payment-method/payment-method.html +++ b/packages/manager/modules/billing-components/src/components/payment-method/payment-method.html @@ -38,7 +38,11 @@
{{ 'payment_expiration_no_default_method_message' | translate}}
@@ -127,7 +127,7 @@ class="oui-link_icon" data-ng-href="{{ $ctrl.updateLink }}" data-ng-if="$ctrl.autorenewLink && !$ctrl.serviceInfos.hasParticularRenew() && !$ctrl.serviceInfos.hasPendingResiliation() && !$ctrl.serviceInfos.hasDebt() && !$ctrl.serviceInfos.isOneShot() && !$ctrl.serviceInfos.hasForcedRenew() && !$ctrl.serviceInfos.isResiliated() && $ctrl.serviceInfos.canHandleRenew() && !$ctrl.serviceInfos.hasEngagement()" - data-ng-click="$ctrl.trackAction('go-to-configure-renew')" + data-ng-click="$ctrl.trackAction($ctrl.serviceInfos.hasAutomaticRenew() ?'edit-frequency': 'renew', !$ctrl.serviceInfos.hasAutomaticRenew())" target="_top" >
@@ -160,7 +160,7 @@ class="oui-link_icon" data-ng-href="{{ $ctrl.autorenewLink && !$ctrl.service.hasBillingRights($ctrl.user.nichandle) ? $ctrl.warningLink : $ctrl.billingLink }}" data-ng-if="$ctrl.serviceInfos.hasDebt()" - data-on-click="$ctrl.trackAction('go-to-pay-bill')" + data-ng-click="$ctrl.trackAction('go-to-pay-bill')" target="_top" >
@@ -190,7 +190,7 @@ class="oui-link_icon" data-ng-if="$ctrl.resiliateLink && ($ctrl.serviceInfos.hasAdminRights($ctrl.user.auth.account) || $ctrl.serviceInfos.hasAdminRights($ctrl.user.nichandle))" data-ng-href="{{ $ctrl.resiliateLink }}" - on-click="$ctrl.trackAction('go-to-resiliate')" + data-ng-click="$ctrl.trackAction('stop', true)" target="_top" >
@@ -218,7 +218,7 @@ class="oui-link_icon" data-ng-if="$ctrl.resiliateLink && ($ctrl.serviceInfos.hasAdminRights($ctrl.user.auth.account) || $ctrl.serviceInfos.hasAdminRights($ctrl.user.nichandle))" data-ng-href="{{ $ctrl.resiliateLink }}" - on-click="$ctrl.trackAction('go-to-resiliate')" + data-ng-click="$ctrl.trackAction('stop', true)" target="_top" >
diff --git a/packages/manager/modules/billing/src/autoRenew/agreements/user-agreements.routes.js b/packages/manager/modules/billing/src/autoRenew/agreements/user-agreements.routes.js index bd2fc549f3d8..ecf52db6ef4c 100644 --- a/packages/manager/modules/billing/src/autoRenew/agreements/user-agreements.routes.js +++ b/packages/manager/modules/billing/src/autoRenew/agreements/user-agreements.routes.js @@ -1,5 +1,9 @@ import controller from './user-agreements.controller'; import template from './user-agreements.html'; +import { + TRACKING_AGREEMENTS_PAGE_NAME, + TRACKING_PAGE_CATEGORY, +} from '../autorenew.constants'; export default /* @ngInject */ ( $stateProvider, @@ -19,6 +23,15 @@ export default /* @ngInject */ ( (currentUser) => currentUser.isTrusted && 'app.account.billing.autorenew', ), + atInternet: { + ignore: true, + }, + onEnter: /* @ngInject */ (atInternet) => { + atInternet.trackPage({ + name: TRACKING_AGREEMENTS_PAGE_NAME, + page_category: TRACKING_PAGE_CATEGORY, + }); + }, resolve: { gotoAcceptAllAgreements: /* @ngInject */ ($state, atInternet) => ( agreements, diff --git a/packages/manager/modules/billing/src/autoRenew/autorenew.constants.js b/packages/manager/modules/billing/src/autoRenew/autorenew.constants.js index f7f4252f026c..ed5d9d24eeea 100644 --- a/packages/manager/modules/billing/src/autoRenew/autorenew.constants.js +++ b/packages/manager/modules/billing/src/autoRenew/autorenew.constants.js @@ -75,6 +75,22 @@ export const SERVICE_STATUS = { export const URL_PARAMETER_SEPARATOR = '%20'; +const TRACKING_CHAPTER_1 = 'Hub'; +const TRACKING_CHAPTER_2 = 'billing'; +const TRACKING_CHAPTER_3 = 'services'; + +const TRACKING_PAGE_SUFFIX = 'services::listing::autorenew'; +export const TRACKING_PAGE_CATEGORY = 'listing'; +export const TRACKING_PAGE = `${TRACKING_CHAPTER_1}::${TRACKING_CHAPTER_2}::${TRACKING_CHAPTER_3}::${TRACKING_PAGE_SUFFIX}`; +export const TRACKING_FILTER_NAME_PREFIX = + 'Hub::billing::services::listing::button::filter_services'; + +export const TRACKING_AUTORENEW_PAGE_NAME = `Hub::billing::services::services::listing::autorenew`; +export const TRACKING_SSH_PAGE_NAME = `${TRACKING_AUTORENEW_PAGE_NAME}::ssh`; +export const TRACKING_AGREEMENTS_PAGE_NAME = `${TRACKING_AUTORENEW_PAGE_NAME}::agreements`; + +export const TRACKING_ACTIONS_PREFIX = `${TRACKING_CHAPTER_1}::${TRACKING_CHAPTER_2}::${TRACKING_CHAPTER_3}::${TRACKING_PAGE_CATEGORY}`; + export default { AUTORENEW_EVENT, CONTRACTS_IDS, diff --git a/packages/manager/modules/billing/src/autoRenew/autorenew.controller.js b/packages/manager/modules/billing/src/autoRenew/autorenew.controller.js index bbb40e667da8..161185fa93a2 100644 --- a/packages/manager/modules/billing/src/autoRenew/autorenew.controller.js +++ b/packages/manager/modules/billing/src/autoRenew/autorenew.controller.js @@ -10,6 +10,10 @@ import { COLUMNS_CONFIG, NIC_ALL, URL_PARAMETER_SEPARATOR, + TRACKING_FILTER_NAME_PREFIX, + TRACKING_PAGE_CATEGORY, + TRACKING_PAGE, + TRACKING_ACTIONS_PREFIX, } from './autorenew.constants'; export default class AutorenewCtrl { @@ -35,6 +39,10 @@ export default class AutorenewCtrl { } $onInit() { + this.trackingPage = TRACKING_PAGE; + this.trackingCategory = TRACKING_PAGE_CATEGORY; + this.trackingActionsPrefix = TRACKING_ACTIONS_PREFIX; + this.ALIGNMENT_URL = this.coreConfig.isRegion('EU') ? ALIGNMENT_URLS[this.currentUser.ovhSubsidiary] || ALIGNMENT_URLS.FR : null; @@ -86,6 +94,7 @@ export default class AutorenewCtrl { this.hideHeaderGuide = Object.keys(this.guides.url.my_services).length === 0; } + this.currentCriteria = JSON.parse(JSON.stringify(this.criteria)); } descriptionOfHeading() { @@ -198,6 +207,13 @@ export default class AutorenewCtrl { } onCriteriaChange($criteria) { + const newCriteria = $criteria.find( + (f) => + !this.currentCriteria.some( + (s) => s.property === f.property && s.value === f.value, + ), + ); + const selectedType = find($criteria, { property: 'serviceType' }); const searchText = find($criteria, { property: null }); const filters = reduce( @@ -215,6 +231,17 @@ export default class AutorenewCtrl { {}, ); + if (newCriteria) { + this.atInternet.trackClick({ + name: `${TRACKING_FILTER_NAME_PREFIX}::go-to-${newCriteria.property?.toLowerCase()}-${newCriteria.value?.toLowerCase()}::service`, + type: 'action', + page_category: TRACKING_PAGE_CATEGORY, + page: { + name: TRACKING_PAGE, + }, + }); + } + this.onListParamChanges({ filters: JSON.stringify(filters), selectedType: get(selectedType, 'value'), diff --git a/packages/manager/modules/billing/src/autoRenew/autorenew.html b/packages/manager/modules/billing/src/autoRenew/autorenew.html index 9382d7964fc9..bcd8b6868ebc 100644 --- a/packages/manager/modules/billing/src/autoRenew/autorenew.html +++ b/packages/manager/modules/billing/src/autoRenew/autorenew.html @@ -76,7 +76,11 @@