From d9edec5fc16e0a90fa879a570ca116c9dd06bcba Mon Sep 17 00:00:00 2001 From: jpaten Date: Wed, 16 Oct 2024 15:59:47 -0700 Subject: [PATCH 1/2] chore: added tracking id to SupportRequestFOrm (#221) --- .../components/SupportRequestForm/supportRequestForm.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.tsx b/src/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.tsx index d96764d4..060965d8 100644 --- a/src/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.tsx +++ b/src/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.tsx @@ -249,6 +249,7 @@ export const SupportRequestForm = ({ disabled={Boolean(errors) || formState.submitting} fullWidth onClick={onSupportRequestSubmitted} + id="button-support-request" > Send From 2c70036276b40c1fb9b9851f8c1ff345e5f8f531 Mon Sep 17 00:00:00 2001 From: jpaten Date: Wed, 16 Oct 2024 16:39:08 -0700 Subject: [PATCH 2/2] chore: updated ga documentation (#221) --- src/common/analytics/readme-analytics.md | 24 +++++++++++++------ .../SupportRequestForm/supportRequestForm.tsx | 2 -- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/common/analytics/readme-analytics.md b/src/common/analytics/readme-analytics.md index fbaa76eb..fdaa44d5 100644 --- a/src/common/analytics/readme-analytics.md +++ b/src/common/analytics/readme-analytics.md @@ -6,10 +6,20 @@ See below a list of the currently available events. ### GA4 Event Inventory -| Event | Parameters | Description | -| ------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `bulk_download_requested` | `catalog`, `current_query`, `entity_type`, `index`, `tool_name` | Runs when the HCA-DCP "Request curl command" button is selected | -| `entity_selected` | `entity_name` | Runs when an entity (tab) is selected | -| `entity_table_paginated` | `entity_name`, `pagination_directed` | Runs when the page forward/backwards buttons are clicked | -| `entity_table_sorted` | `entity_name`, `column_name`, `sort_direction` | Runs each time a column in the entity table is sorted | -| `filter_selected` | `filter_name`, `filter_value` | Runs each time a filter is selected | +| Event | Parameters | Description | +| ------------------------- | ------------------------------------------------ | --------------------------------------------------------------- | +| `bulk_download_requested` | `catalog`, `current_query`, `index`, `tool_name` | Runs when the HCA-DCP "Request curl command" button is selected | +| `entity_selected` | `entity_name` | Runs when an entity (tab) is selected | +| `entity_table_paginated` | `entity_name`, `pagination_direction` | Runs when the page forward/backwards buttons are clicked | +| `entity_table_sorted` | `entity_name`, `column_name`, `sort_direction` | Runs each time a column in the entity table is sorted | +| `filter_selected` | `filter_name`, `filter_value` | Runs each time a filter is selected | + +### Tracking-related ID Inventory + +Some GA4 Events are tracked using ids instead of events. Below is an inventory of the ids that, when clicked, trigger an event: + +| Component | Id name | "All Elements" or "Just Links"? | Purpose | +| -------------------- | -------------------------------- | ------------------------------- | ------------------------------------------- | +| `SupportRequestForm` | `button-support-request` | "All Elements" | To track submitted support requests | +| `ExportMethod` | The value passed as `trackingId` | "All Elements" | To separately track ExportMethod events | +| `ExportButton` | `button-cohort-export` | "Just Links" | To track clicks to the Cohort Export button | diff --git a/src/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.tsx b/src/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.tsx index 060965d8..9f7cd4cf 100644 --- a/src/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.tsx +++ b/src/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.tsx @@ -145,8 +145,6 @@ export const SupportRequestForm = ({ submitting: false, })); setFormSubmitted(true); // Shows form submitted message. - // Execute GTM tracking. - // TODO(cc) add GTM tracking. } catch (error) { setFormState((formState) => ({ ...formState,