@@ -26,8 +26,8 @@ export const SideBar = ({
dataCollectionRef,
}}
/>
- {monitorPromo && !monitorPromo.hidePromo && (
-
+ {vpnPromo && !vpnPromo.hidePromo && (
+
)}
);
diff --git a/packages/fxa-settings/src/lib/glean/index.test.ts b/packages/fxa-settings/src/lib/glean/index.test.ts
index efb8e1b905d..ac590165e72 100644
--- a/packages/fxa-settings/src/lib/glean/index.test.ts
+++ b/packages/fxa-settings/src/lib/glean/index.test.ts
@@ -866,6 +866,30 @@ describe('lib/glean', () => {
sinon.assert.called(spy);
});
+ it('submits a ping with the account_pref_promo_vpn_view event name', async () => {
+ GleanMetrics.accountPref.promoVpnView();
+ const spy = sandbox.spy(accountPref.promoVpnView, 'record');
+ await GleanMetrics.isDone();
+ sinon.assert.calledOnce(setEventNameStub);
+ sinon.assert.calledWith(
+ setEventNameStub,
+ 'account_pref_promo_vpn_view'
+ );
+ sinon.assert.called(spy);
+ });
+
+ it('submits a ping with the account_pref_promo_vpn_submit event name', async () => {
+ GleanMetrics.accountPref.promoVpnSubmit();
+ const spy = sandbox.spy(accountPref.promoVpnSubmit, 'record');
+ await GleanMetrics.isDone();
+ sinon.assert.calledOnce(setEventNameStub);
+ sinon.assert.calledWith(
+ setEventNameStub,
+ 'account_pref_promo_vpn_submit'
+ );
+ sinon.assert.called(spy);
+ });
+
it('submits a ping with the account_pref_bento_view event name', async () => {
GleanMetrics.accountPref.bentoView();
const spy = sandbox.spy(accountPref.bentoView, 'record');
diff --git a/packages/fxa-settings/src/lib/glean/index.ts b/packages/fxa-settings/src/lib/glean/index.ts
index 54a52d20e77..672af091dc2 100644
--- a/packages/fxa-settings/src/lib/glean/index.ts
+++ b/packages/fxa-settings/src/lib/glean/index.ts
@@ -652,6 +652,12 @@ const recordEventMetric = (
reason: gleanPingMetrics?.event?.['reason'] || '',
});
break;
+ case 'account_pref_promo_vpn_view':
+ accountPref.promoVpnView.record();
+ break;
+ case 'account_pref_promo_vpn_submit':
+ accountPref.promoVpnSubmit.record();
+ break;
case 'account_pref_mfa_guard_view':
accountPref.mfaGuardView.record({
reason: gleanPingMetrics?.event?.['reason'] || '',
diff --git a/packages/fxa-settings/src/lib/utilities.ts b/packages/fxa-settings/src/lib/utilities.ts
index c043aba9bac..7579361e18b 100644
--- a/packages/fxa-settings/src/lib/utilities.ts
+++ b/packages/fxa-settings/src/lib/utilities.ts
@@ -142,12 +142,12 @@ export function resetOnce() {
/**
* Constructs a URL with UTM parameters appended to the query string.
*
- * @param {string} pathname - The base URL path.
- * @param {'mozilla-websites' | 'product-partnership' | 'referral'} utmMedium - The medium through which the link is being shared.
- * @param {'moz-account'} utmSource - The source of the traffic.
- * @param {'bento' | 'sidebar' | 'settings' } utmTerm - The search term or keyword associated with the campaign.
- * @param {'fx-desktop' | 'fx-mobile' | 'monitor' | 'monitor-free' | 'relay' | 'vpn' | 'get-free-scan-global' | 'get-year-round-protection-us' } utmContent - The specific content or product that the link is associated with.
- * @param {'permanent' | 'settings-promo' | 'connect-device'} utmCampaign - The name of the marketing campaign.
+ * @param pathname - The base URL path.
+ * @param utmMedium - The medium through which the link is being shared.
+ * @param utmSource - The source of the traffic.
+ * @param utmTerm - The search term or keyword associated with the campaign.
+ * @param utmContent - The specific content or product that the link is associated with.
+ * @param utmCampaign - The name of the marketing campaign.
* @returns {string} - The constructed URL with UTM parameters.
*/
export const constructHrefWithUtm = (
@@ -164,7 +164,7 @@ export const constructHrefWithUtm = (
| 'vpn'
| 'get-free-scan-global'
| 'get-year-round-protection-us',
- utmCampaign?: 'permanent' | 'settings-promo' | 'connect-device'
+ utmCampaign?: 'permanent' | 'settings-promo' | 'promo' | 'connect-device'
) => {
const pairs: [string, string | undefined | null][] = [
['utm_source', utmSource],
diff --git a/packages/fxa-shared/metrics/glean/fxa-ui-metrics.yaml b/packages/fxa-shared/metrics/glean/fxa-ui-metrics.yaml
index 00bbaee3389..ebd8b65aa18 100644
--- a/packages/fxa-shared/metrics/glean/fxa-ui-metrics.yaml
+++ b/packages/fxa-shared/metrics/glean/fxa-ui-metrics.yaml
@@ -2961,6 +2961,40 @@ account_pref:
reason:
description: What plan user is using `free` or `plus`
type: string
+ promo_vpn_view:
+ type: event
+ description: |
+ User sees the VPN promo on their settings page.
+ send_in_pings:
+ - events
+ notification_emails:
+ - vzare@mozilla.com
+ - fxa-staff@mozilla.com
+ bugs:
+ - https://mozilla-hub.atlassian.net/browse/FXA-12815
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1830504
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1844121
+ expires: never
+ data_sensitivity:
+ - interaction
+ promo_vpn_submit:
+ type: event
+ description: |
+ User clicks on the Get VPN link on the VPN promotion in the account settings.
+ send_in_pings:
+ - events
+ notification_emails:
+ - vzare@mozilla.com
+ - fxa-staff@mozilla.com
+ bugs:
+ - https://mozilla-hub.atlassian.net/browse/FXA-12815
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1830504
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1844121
+ expires: never
+ data_sensitivity:
+ - interaction
bento_view:
type: event
description: |
diff --git a/packages/fxa-shared/metrics/glean/web/accountPref.ts b/packages/fxa-shared/metrics/glean/web/accountPref.ts
index f54eb5b55d7..6dcf17218bb 100644
--- a/packages/fxa-shared/metrics/glean/web/accountPref.ts
+++ b/packages/fxa-shared/metrics/glean/web/accountPref.ts
@@ -353,6 +353,38 @@ export const promoMonitorView = new EventMetricType<{
['reason']
);
+/**
+ * User clicks on the Get VPN link on the VPN promotion in the account settings.
+ *
+ * Generated from `account_pref.promo_vpn_submit`.
+ */
+export const promoVpnSubmit = new EventMetricType(
+ {
+ category: 'account_pref',
+ name: 'promo_vpn_submit',
+ sendInPings: ['events'],
+ lifetime: 'ping',
+ disabled: false,
+ },
+ []
+);
+
+/**
+ * User sees the VPN promo on their settings page.
+ *
+ * Generated from `account_pref.promo_vpn_view`.
+ */
+export const promoVpnView = new EventMetricType(
+ {
+ category: 'account_pref',
+ name: 'promo_vpn_view',
+ sendInPings: ['events'],
+ lifetime: 'ping',
+ disabled: false,
+ },
+ []
+);
+
/**
* Click on "Create" or "Change" button on account settings page to add a recovery
* key to the account
diff --git a/packages/fxa-shared/metrics/glean/web/index.ts b/packages/fxa-shared/metrics/glean/web/index.ts
index f968fc420df..7bd258a544b 100644
--- a/packages/fxa-shared/metrics/glean/web/index.ts
+++ b/packages/fxa-shared/metrics/glean/web/index.ts
@@ -235,6 +235,8 @@ export const eventsMap = {
help: 'account_pref_help',
promoMonitorView: 'account_pref_promo_monitor_view',
promoMonitorSubmit: 'account_pref_promo_monitor_submit',
+ promoVpnView: 'account_pref_promo_vpn_view',
+ promoVpnSubmit: 'account_pref_promo_vpn_submit',
bentoView: 'account_pref_bento_view',
bentoFirefoxDesktop: 'account_pref_bento_firefox_desktop',
bentoFirefoxMobile: 'account_pref_bento_firefox_mobile',