From a435d9861687c48c7908e787a1ff027f17447c49 Mon Sep 17 00:00:00 2001 From: Vijay Budhram Date: Fri, 21 Jun 2024 12:35:43 -0400 Subject: [PATCH] feat(metrics): Add Glean metrics for "set password" screen for third party auth --- .../app/scripts/lib/glean/index.ts | 16 ++++++++-------- .../app/tests/spec/lib/glean.js | 18 +++++++++--------- .../metrics/glean/fxa-ui-metrics.yaml | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/fxa-content-server/app/scripts/lib/glean/index.ts b/packages/fxa-content-server/app/scripts/lib/glean/index.ts index 06361bf9f1..490ae6be15 100644 --- a/packages/fxa-content-server/app/scripts/lib/glean/index.ts +++ b/packages/fxa-content-server/app/scripts/lib/glean/index.ts @@ -253,16 +253,16 @@ const recordEventMetric = (eventName: string, properties: EventProperties) => { case 'cad_mobile_pair_view': cadMobilePair.view.record(); break; - case 'set_password_third_party_auth_view': + case 'third_party_auth_set_password_view': setPasswordThirdPartyAuth.view.record(); break; - case 'set_password_third_party_auth_engage': + case 'third_party_auth_set_password_engage': setPasswordThirdPartyAuth.engage.record(); break; - case 'set_password_third_party_auth_submit': + case 'third_party_auth_set_password_submit': setPasswordThirdPartyAuth.submit.record(); break; - case 'set_password_third_party_auth_success': + case 'third_party_auth_set_password_success': setPasswordThirdPartyAuth.success.record(); break; } @@ -378,10 +378,10 @@ export const GleanMetrics = { view: createEventFn('cad_approve_device_view'), }, setPasswordThirdPartyAuth: { - view: createEventFn('set_password_third_party_auth_view'), - engage: createEventFn('set_password_third_party_auth_engage'), - submit: createEventFn('set_password_third_party_auth_submit'), - success: createEventFn('set_password_third_party_auth_success'), + view: createEventFn('third_party_auth_set_password_view'), + engage: createEventFn('third_party_auth_set_password_engage'), + submit: createEventFn('third_party_auth_set_password_submit'), + success: createEventFn('third_party_auth_set_password_success'), }, }; diff --git a/packages/fxa-content-server/app/tests/spec/lib/glean.js b/packages/fxa-content-server/app/tests/spec/lib/glean.js index df5dc50193..53acf75e40 100644 --- a/packages/fxa-content-server/app/tests/spec/lib/glean.js +++ b/packages/fxa-content-server/app/tests/spec/lib/glean.js @@ -457,40 +457,40 @@ describe('lib/glean', () => { }); }); - describe('set_password_third_party_auth', () => { - it('submits a ping with the set_password_third_party_auth_view event name', async () => { + describe('third_party_auth_set_password', () => { + it('submits a ping with the third_party_auth_set_password_view event name', async () => { await GleanMetrics.setPasswordThirdPartyAuth.view(); sinon.assert.calledOnce(setEventNameStub); sinon.assert.calledWith( setEventNameStub, - 'set_password_third_party_auth_view' + 'third_party_auth_set_password_view' ); }); - it('submits a ping with the set_password_third_party_auth_engage event name', async () => { + it('submits a ping with the third_party_auth_set_password_engage event name', async () => { await GleanMetrics.setPasswordThirdPartyAuth.engage(); sinon.assert.calledOnce(setEventNameStub); sinon.assert.calledWith( setEventNameStub, - 'set_password_third_party_auth_engage' + 'third_party_auth_set_password_engage' ); }); - it('submits a ping with the set_password_third_party_auth_submit event name', async () => { + it('submits a ping with the third_party_auth_set_password_submit event name', async () => { await GleanMetrics.setPasswordThirdPartyAuth.submit(); sinon.assert.calledOnce(setEventNameStub); sinon.assert.calledWith( setEventNameStub, - 'set_password_third_party_auth_submit' + 'third_party_auth_set_password_submit' ); }); - it('submits a ping with the set_password_third_party_auth_success event name', async () => { + it('submits a ping with the third_party_auth_set_password_success event name', async () => { await GleanMetrics.setPasswordThirdPartyAuth.success(); sinon.assert.calledOnce(setEventNameStub); sinon.assert.calledWith( setEventNameStub, - 'set_password_third_party_auth_success' + 'third_party_auth_set_password_success' ); }); }); diff --git a/packages/fxa-shared/metrics/glean/fxa-ui-metrics.yaml b/packages/fxa-shared/metrics/glean/fxa-ui-metrics.yaml index c15e245658..610c86071e 100644 --- a/packages/fxa-shared/metrics/glean/fxa-ui-metrics.yaml +++ b/packages/fxa-shared/metrics/glean/fxa-ui-metrics.yaml @@ -1300,7 +1300,7 @@ cad_mobile_pair: data_sensitivity: - interaction -set_password_third_party_auth: +third_party_auth_set_password: view: type: event description: |