Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tracking to SupportRequestForm #223

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions src/common/analytics/readme-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -249,6 +247,7 @@ export const SupportRequestForm = ({
disabled={Boolean(errors) || formState.submitting}
fullWidth
onClick={onSupportRequestSubmitted}
id="button-support-request"
>
Send
</ButtonPrimary>
Expand Down
Loading