diff --git a/packages/manager/apps/web/client/app/hosting/multisite/git-integration/association/git-association.controller.js b/packages/manager/apps/web/client/app/hosting/multisite/git-integration/association/git-association.controller.js index 03f84830ff64..80253566ef78 100644 --- a/packages/manager/apps/web/client/app/hosting/multisite/git-integration/association/git-association.controller.js +++ b/packages/manager/apps/web/client/app/hosting/multisite/git-integration/association/git-association.controller.js @@ -8,6 +8,7 @@ import { GIT_ASSOCIATION_GUIDE_LINK, GIT_WEBHOOK_GUIDE_LINK, } from './git-association.constants'; +import { TRACKING_MULTISITE_PREFIX } from '../git-integration.constants'; export default class HostingMultisiteGitAssociationController { /* @ngInject */ @@ -15,6 +16,7 @@ export default class HostingMultisiteGitAssociationController { HostingMultisiteGitAssociationService, coreURLBuilder, coreConfig, + atInternet, $translate, ) { this.REPOSITORY_PLACEHOLDER = REPOSITORY_PLACEHOLDER; @@ -26,6 +28,7 @@ export default class HostingMultisiteGitAssociationController { this.HostingMultisiteGitAssociationService = HostingMultisiteGitAssociationService; this.coreURLBuilder = coreURLBuilder; this.$translate = $translate; + this.atInternet = atInternet; const { ovhSubsidiary } = coreConfig.getUser(); this.GIT_ASSOCIATION_GUIDE_LINK = GIT_ASSOCIATION_GUIDE_LINK[ovhSubsidiary] || @@ -56,6 +59,10 @@ export default class HostingMultisiteGitAssociationController { } applyConfiguration() { + this.atInternet.trackClick({ + name: `${TRACKING_MULTISITE_PREFIX}::git-association::confirm`, + type: 'action', + }); const promise = this.isConfiguration ? this.HostingMultisiteGitAssociationService.putWebsiteAssociated( this.serviceName, diff --git a/packages/manager/apps/web/client/app/hosting/multisite/git-integration/deployment/git-deployment.controller.js b/packages/manager/apps/web/client/app/hosting/multisite/git-integration/deployment/git-deployment.controller.js index a4ff4072a834..276987f20b77 100644 --- a/packages/manager/apps/web/client/app/hosting/multisite/git-integration/deployment/git-deployment.controller.js +++ b/packages/manager/apps/web/client/app/hosting/multisite/git-integration/deployment/git-deployment.controller.js @@ -1,3 +1,5 @@ +import { TRACKING_MULTISITE_PREFIX } from '../git-integration.constants'; + export default class HostingMultisiteGitDeploymentController { /* @ngInject */ constructor( @@ -5,11 +7,13 @@ export default class HostingMultisiteGitDeploymentController { HostingDomain, coreURLBuilder, $translate, + atInternet, ) { this.HostingMultisiteGitDeploymentService = HostingMultisiteGitDeploymentService; this.HostingDomain = HostingDomain; this.coreURLBuilder = coreURLBuilder; this.$translate = $translate; + this.atInternet = atInternet; this.gitForcePush = false; } @@ -25,6 +29,10 @@ export default class HostingMultisiteGitDeploymentController { } deployment() { + this.atInternet.trackClick({ + name: `${TRACKING_MULTISITE_PREFIX}::git-deployment::confirm`, + type: 'action', + }); this.isDeploying = true; this.HostingMultisiteGitDeploymentService.postWebsiteDeploy( this.serviceName, diff --git a/packages/manager/apps/web/client/app/hosting/multisite/git-integration/git-integration.constants.js b/packages/manager/apps/web/client/app/hosting/multisite/git-integration/git-integration.constants.js new file mode 100644 index 000000000000..3f96a2748d4b --- /dev/null +++ b/packages/manager/apps/web/client/app/hosting/multisite/git-integration/git-integration.constants.js @@ -0,0 +1,5 @@ +export const TRACKING_MULTISITE_PREFIX = 'web::hosting::dashboard::multisite'; + +export default { + TRACKING_MULTISITE_PREFIX, +}; diff --git a/packages/manager/apps/web/client/app/hosting/multisite/git-integration/removal/git-removal.controller.js b/packages/manager/apps/web/client/app/hosting/multisite/git-integration/removal/git-removal.controller.js index 1823b6d42bad..754a6b6b0cce 100644 --- a/packages/manager/apps/web/client/app/hosting/multisite/git-integration/removal/git-removal.controller.js +++ b/packages/manager/apps/web/client/app/hosting/multisite/git-integration/removal/git-removal.controller.js @@ -1,8 +1,16 @@ +import { TRACKING_MULTISITE_PREFIX } from '../git-integration.constants'; + export default class HostingMultisiteGitDeploymentController { /* @ngInject */ - constructor($translate, HostingDomain, HostingMultisiteGitRemovalService) { + constructor( + $translate, + atInternet, + HostingDomain, + HostingMultisiteGitRemovalService, + ) { this.isConfirmationStep = false; this.$translate = $translate; + this.atInternet = atInternet; this.HostingMultisiteGitRemovalService = HostingMultisiteGitRemovalService; this.HostingDomain = HostingDomain; } @@ -22,6 +30,10 @@ export default class HostingMultisiteGitDeploymentController { } deleteGitAssociation(deleteFiles) { + this.atInternet.trackClick({ + name: `${TRACKING_MULTISITE_PREFIX}::git-removal::confirm`, + type: 'action', + }); this.isDeleting = true; this.HostingDomain.getWebsitesAssociated(this.serviceName, this.path) .then(([websiteId]) => { diff --git a/packages/manager/apps/web/client/app/hosting/multisite/hosting-multisite.controller.js b/packages/manager/apps/web/client/app/hosting/multisite/hosting-multisite.controller.js index 49516a51b3a4..21f0272ddc71 100644 --- a/packages/manager/apps/web/client/app/hosting/multisite/hosting-multisite.controller.js +++ b/packages/manager/apps/web/client/app/hosting/multisite/hosting-multisite.controller.js @@ -20,6 +20,7 @@ import { HOSTING_TAB_DOMAINS, RECORD_TYPE_TO_IP_TYPE, } from './hosting-multisite.constants'; +import { TRACKING_MULTISITE_PREFIX } from './git-integration/git-integration.constants'; const CDN_STATISTICS_PERIOD = { DAY: 'day', @@ -443,26 +444,42 @@ angular $scope.setAction('multisite/update/hosting-multisite-update', domain); }; - $scope.goToRemoveRepository = (domain) => + $scope.goToRemoveRepository = (domain) => { + sendTrackClick(`${TRACKING_MULTISITE_PREFIX}::git-removal`); $scope.$resolve.goToRemoveRepository( $scope.hosting.serviceName, domain.path, ); + }; - $scope.goToAssociateRepository = (domain) => + $scope.goToAssociateRepository = (domain) => { + sendTrackClick(`${TRACKING_MULTISITE_PREFIX}::add-git`); $scope.$resolve.goToAssociateRepository( $scope.hosting.serviceName, domain, ); + }; $scope.goToConfigureGit = (domain) => $scope.$resolve.goToConfigureGit($scope.hosting.serviceName, domain); - $scope.goToDeployWebSite = (domain) => - $scope.$resolve.goToDeployWebSite($scope.hosting.serviceName, domain); + $scope.goToDeployWebSite = (domain) => { + sendTrackClick(`${TRACKING_MULTISITE_PREFIX}::git-deployment`); + return $scope.$resolve.goToDeployWebSite( + $scope.hosting.serviceName, + domain, + ); + }; - $scope.goToViewLastDeploy = (domain) => - $scope.$resolve.goToViewLastDeploy($scope.hosting.serviceName, domain); + $scope.goToViewLastDeploy = (domain) => { + sendTrackClick( + `${TRACKING_MULTISITE_PREFIX}::git-view-last-deployment`, + ); + return $scope.$resolve.goToViewLastDeploy( + $scope.hosting.serviceName, + domain, + ); + }; $scope.restartDomain = (domain) => HostingDomain.restartVirtualHostOfAttachedDomain(