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

Apply GA4 tracking to flash alerts #9820

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

gtvj
Copy link
Contributor

@gtvj gtvj commented Jan 16, 2025

What

Adds GA4 tracking to flash alerts via the GA4 Auto Tracker.

Expected datalayer

event_data':{
    'event_name':'flash_message',
    'text':'<flash text>',
    'action':error
}

Why

We want to understand when users have disruptions in their journey.

Screen / data layer screenshots after change

Data attributes are present in flash alert Screenshot of data attributes present in Flash alerts
Data attributes are not present in flash success

Screenshot 2025-01-16 at 12 23 36

Performance Analyst review

Implementation has been tested by PAs in Integration who confirm the data is present as expected.

@gtvj gtvj force-pushed the 3317-apply-alert-tracking-to-flash-alerts branch 5 times, most recently from ca710a9 to fa9af73 Compare January 16, 2025 14:47
@ChrisBAshton ChrisBAshton force-pushed the 3317-apply-alert-tracking-to-flash-alerts branch from fa9af73 to e90c5b7 Compare January 20, 2025 10:44
@gtvj gtvj force-pushed the 3317-apply-alert-tracking-to-flash-alerts branch 4 times, most recently from 11061eb to e7d6afd Compare January 21, 2025 15:11
@gtvj gtvj force-pushed the 3317-apply-alert-tracking-to-flash-alerts branch from e7d6afd to 2dade43 Compare January 21, 2025 17:18
Introduces the data_attributes required for `ga4-auto-tracker` to
only the flash alert component. This has been achieved by:

1. Passing `data_attributes` to `flash_message_component.html.erb`.
2. Adding a  `data_attributes` property to `Admin::FlashMessageComponent`
   (so it is available to all extending components).
3. Populating `data_attributes` in `Admin::FlashAlertComponent` with
   required properties.
@gtvj gtvj force-pushed the 3317-apply-alert-tracking-to-flash-alerts branch from 2dade43 to 69bf344 Compare January 30, 2025 13:35
Copy link
Contributor

@ryanb-gds ryanb-gds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📸

@gtvj gtvj merged commit 93973fd into main Feb 3, 2025
19 checks passed
@gtvj gtvj deleted the 3317-apply-alert-tracking-to-flash-alerts branch February 3, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants