Skip to content

Commit

Permalink
feat(dedicated): applying tracking team feedback
Browse files Browse the repository at this point in the history
 ref: MANAGER-15145

Signed-off-by: soufien mhelhali <[email protected]>
  • Loading branch information
soufien mhelhali committed Nov 14, 2024
1 parent 1c24dbd commit bf46b73
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,28 @@ export default class AgoraIpOrderCtrl {
}

goToIpv4Order() {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}tile::add_additional_ip::select_version::next_ipv4`,
type: 'action',
level2: 57,
});
this.$state.go('app.ip.agora-order.ipv4');
}

goToIpv6Order() {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}tile::add_additional_ip::select_version::next_ipv6`,
type: 'action',
level2: 57,
});
this.$state.go('app.ip.agora-order.ipv6');
}

resumeOrder() {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}link::back_previous_page`,
type: 'action',
level2: 57,
});
return this.$state.go(DASHBOARD_STATE_NAME);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default class AgoraIpV4OrderController {
params: {},
selectedService: null,
selectedServiceRegion: null,
selectedOffer: null,
};
this.loading = {};
this.user = this.$state.params.user;
Expand All @@ -97,6 +98,7 @@ export default class AgoraIpV4OrderController {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}tile::add_additional_ip::edit_step_select_${step}`,
type: 'action',
level2: 57,
});
}

Expand Down Expand Up @@ -214,7 +216,9 @@ export default class AgoraIpV4OrderController {
}

getServiceRegion() {
this.trackClick(`select_service::next_${this.model.selectedService}`);
this.trackClick(
`select_service::next_${this.model.selectedService.serviceName}`,
);
this.loadServiceRegion = true;
this.model.selectedServiceRegion = null;
let request = null;
Expand Down Expand Up @@ -251,17 +255,11 @@ export default class AgoraIpV4OrderController {
});
}

trackParkingLocation() {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}button::add_additional_ip::select_location::next`,
type: 'action',
});
}

trackOrganisationLink() {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}link::add_additional_ip::link_to_organisations_management`,
type: 'action',
level2: 57,
});
}

Expand Down Expand Up @@ -437,7 +435,9 @@ export default class AgoraIpV4OrderController {

manageLoadIpOffers() {
if (this.model.selectedRegion) {
this.trackClick(`select_region::next`);
this.trackClick(
`select_region::next_${this.model.selectedRegion.regionName}`,
);
}

this.loading.ipOffers = true;
Expand Down Expand Up @@ -638,7 +638,7 @@ export default class AgoraIpV4OrderController {
}

onSelectedOfferChange(selectedOffer) {
this.trackClick(`select_solution::next_${this.model.params.selectedOffer}`);
this.model.selectedOffer = selectedOffer;
this.maxSize = IP_AGORA[selectedOffer].maxQty;
this.minSize = IP_AGORA[selectedOffer].minQty;
this.model.params.selectedQuantity = this.minSize;
Expand Down Expand Up @@ -688,12 +688,6 @@ export default class AgoraIpV4OrderController {
quantity: get(this.model.params, 'selectedQuantity', 1),
};

const setup = `${this.model.selectedService}_${this.model.selectedRegion}_${this.model.selectedOffer}`;
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}button::add_additional_ip::confirm::ipv4_${setup}`,
type: 'action',
});

let productToOrder = null;
if (this.isPrivateCloudOffer) {
productToOrder = this.IpAgoraOrder.constructor.createProductToOrder({
Expand Down Expand Up @@ -733,6 +727,15 @@ export default class AgoraIpV4OrderController {
});
}

const setup = `${commonProductProps.destination}_${orderableIpCountry ||
params.selectedCountry?.code ||
''}_${productToOrder.planCode}`;
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}button::add_additional_ip::confirm::ipv4_${setup}`,
type: 'action',
level2: 57,
});

return this.User.getUrlOf('express_order')
.then((url) => {
this.$window.open(
Expand All @@ -744,6 +747,7 @@ export default class AgoraIpV4OrderController {
this.atInternet.trackClick({
name: `${TRACKING_PREFIX}ip::banner-error::add_additional_ip_error::${err}`,
type: 'display',
level2: 57,
});
this.Alerter.error(
this.$translate.instant('ip_order_finish_error'),
Expand Down Expand Up @@ -812,14 +816,36 @@ export default class AgoraIpV4OrderController {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}select::add_additional_ip::${name}`,
type: 'action',
level2: 57,
});
}

trackSelectRegion(region) {
this.trackClick(`select_region::next_${region}`);
}

trackSelectLocation(location) {
this.trackClick(`select_location::next_${location.code}`);
}

offerTraking() {
this.trackClick(`select_solution::next_${this.model.selectedOffer}`);
}

locationTraking() {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}button::add_additional_ip::select_location::next`,
type: 'action',
level2: 57,
});
}

resumeOrder() {
const setup = `${this.model.selectedService}_${this.model.selectedRegion}_${this.model.selectedOffer}`;
const setup = `${this.model.selectedService.serviceName}_${this.model.selectedRegion.regionName}_${this.model.selectedOffer}`;
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}button::add_additional_ip::cancel::ipv4_${setup}`,
type: 'action',
level2: 57,
});

return this.$state.go(DASHBOARD_STATE_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
data-valid="$ctrl.model.selectedRegion"
data-editable="!$ctrl.isLoading"
data-navigation="$ctrl.model.selectedRegion"
data-on-focus="$ctrl.model.selectedRegion && $ctrl.onEditStep('location')"
data-on-focus="$ctrl.model.selectedRegion && $ctrl.onEditStep('region')"
data-on-submit="$ctrl.manageLoadIpOffers()"
>
<div data-ng-show="$ctrl.loading.region" class="text-center">
Expand All @@ -85,7 +85,7 @@
data-variant="light"
data-picture="{{ ::region.icon }}"
data-model="$ctrl.model.selectedRegion"
data-ng-click="trackParkingLocation()"
data-on-change="$ctrl.trackSelectRegion(region.regionName)"
data-values="[region]"
>
</oui-select-picker>
Expand All @@ -102,6 +102,7 @@
data-editable="!$ctrl.isLoading"
data-on-focus="$ctrl.model.params.selectedOffer && $ctrl.onEditStep('solution')"
data-valid="$ctrl.model.params.selectedOffer"
data-on-submit="$ctrl.offerTraking()"
>
<div data-ng-show="$ctrl.loading.ipOffers" class="text-center">
<oui-spinner></oui-spinner>
Expand Down Expand Up @@ -238,6 +239,7 @@ <h4 class="text-center">
data-on-focus="$ctrl.model.params.selectedCountry && $ctrl.onEditStep('location_ip_address')"
data-valid="$ctrl.model.params.selectedCountry"
data-submit-text="{{($ctrl.model.params.selectedOffer.isIpBlockOffer && !$ctrl.isPrivateCloudOffer ? 'ip_agora_table_next_text' : 'ip_agora_table_submit_text') | translate }}"
data-on-submit="$ctrl.locationTraking()"
>
<div
data-ng-show="$ctrl.model.params.selectedOffer.countries.length > 0"
Expand All @@ -257,6 +259,7 @@ <h4 class="text-center">
data-name="description"
data-model="$ctrl.model.params.selectedCountry"
disabled="$ctrl.model.params.selectedOffer.countries.length === 1"
data-on-change="$ctrl.trackSelectLocation($ctrl.model.params.selectedCountry)"
>
<div class="row">
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { FUNNEL_TRACKING_PREFIX } from '../ip-ip-agoraOrder.constant';

export default /* @ngInject */ ($stateProvider) => {
$stateProvider.state('app.ip.agora-order.ipv4', {
url: '/ipv4',
Expand All @@ -16,8 +14,5 @@ export default /* @ngInject */ ($stateProvider) => {
resolve: {
breadcrumb: /* @ngInject */ () => false,
},
atInternet: {
rename: `${FUNNEL_TRACKING_PREFIX}tile::add_additional_ip::select_version::next_ipv4`,
},
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default class AgoraIpV6OrderController {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}tile::add_additional_ip::edit_step_select_${step}`,
type: ACTIONS_SUFFIX,
level2: 57,
});
}

Expand Down Expand Up @@ -209,8 +210,9 @@ export default class AgoraIpV6OrderController {
}

this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}button::add_additional_ip::confirm::ipv6_${trakingService}__free`,
name: `${FUNNEL_TRACKING_PREFIX}button::add_additional_ip::confirm::ipv6_${trakingService}_${regionId}__free`,
type: 'action',
level2: 57,
});

return this.User.getUrlOf('express_order')
Expand All @@ -219,12 +221,13 @@ export default class AgoraIpV6OrderController {
`${url}review?products=${JSURL.stringify([productToOrder])}`,
'_blank',
);
this.goToDashboard();
this.$state.go(DASHBOARD_STATE_NAME);
})
.catch((error) => {
this.atInternet.trackClick({
name: `${TRACKING_PREFIX}ip::banner-error::add_additional_ip_error::${error}`,
type: 'display',
level2: 57,
});

this.Alerter.error(
Expand All @@ -245,17 +248,27 @@ export default class AgoraIpV6OrderController {

goToDashboard() {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}button::add_additional_ip::cancel::ipv6_${this.model.selectedService}__free`,
name: `${FUNNEL_TRACKING_PREFIX}button::add_additional_ip::cancel::ipv6_${this.model.selectedService}_${this.model.selectedPlan.regionId}_free`,
type: 'action',
level2: 57,
});

return this.$state.go(DASHBOARD_STATE_NAME);
}

trackSelectRegion(name) {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}select::add_additional_ip::select_region::next_${name}`,
type: 'action',
level2: 57,
});
}

trackClick(name) {
this.atInternet.trackClick({
name: `${FUNNEL_TRACKING_PREFIX}select::add_additional_ip::${name}`,
type: ACTIONS_SUFFIX,
level2: 57,
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ <h4>
data-disabled="!plan.available"
data-values="[plan]"
oui-tooltip="{{:: $ctrl.getRegionTooltip(plan.available) }}"
data-on-change="$ctrl.trackSelectRegion(plan.regionId)"
>
</oui-select-picker>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { FUNNEL_TRACKING_PREFIX } from '../ip-ip-agoraOrder.constant';

export default /* @ngInject */ ($stateProvider) => {
$stateProvider.state('app.ip.agora-order.ipv6', {
url: '/ipv6',
Expand All @@ -10,8 +8,5 @@ export default /* @ngInject */ ($stateProvider) => {
resolve: {
breadcrumb: /* @ngInject */ () => false,
},
atInternet: {
rename: `${FUNNEL_TRACKING_PREFIX}tile::add_additional_ip::select_version::next_ipv6`,
},
});
};
10 changes: 10 additions & 0 deletions packages/manager/apps/dedicated/client/app/ip/ip.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default /* @ngInject */ function IpMainCtrl(
$scope,
$timeout,
$translate,
atInternet,
Alerter,
coreConfig,
currentUser,
Expand Down Expand Up @@ -118,6 +119,15 @@ export default /* @ngInject */ function IpMainCtrl(
goToDashboard();
};

$scope.goToFailoverWithTracking = (params) => {
atInternet.trackClick({
name: `DedicatedServers::network::ip::banner::link::see_unused_ips`,
type: 'action',
level2: 57,
});
goToFailover(params);
};

$scope.onFailoverTabClick = function onFailoverTabClick() {
if (!isFailoverActive()) {
trackClick(DASHBOARD_TRACKING_PREFIX.DEFAULT, FAILOVER_TRACKING_HIT.TAB);
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/apps/dedicated/client/app/ip/ip.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h1 class="oui-header__title">
<button
class="btn btn-link"
type="button"
data-ng-click="goToFailover({ unused: '1' })"
data-ng-click="goToFailoverWithTracking({ unused: '1' })"
data-ng-if="!isFailoverActive({ unused: '1' })"
>
<span data-translate="ip_unused_banner_link"></span>
Expand Down

0 comments on commit bf46b73

Please sign in to comment.