Implement/refactor GA tracking events for remote site notifications
See original GitHub issueFeature Description
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The following new GA tracking events should be triggered related to remote site notifications coming from the proxy (see
core/site/data/notifications
):view_notification
: A remote notification is rendered.confirm_notification
: User clicks the primary CTA on a remote notification (only relevant if the notification includes one).dismiss_notification
: User dismisses a remote notification (only relevant if the notification can be dismissed).click_learn_more_link
: User clicks on the learn more link on a remote notification (only relevant if the notification includes a learn more link).- All of the above events should use
dashboard_site-notification
as event category. - All of the above events should also pass an event label, using the notification ID (which also comes from the API).
- The currently present
accepted
anddismissed
events around site notifications should be removed.
Implementation Brief
trackEvent
mentioned in the bullet points below should be imported fromassets/js/util/tracking/index.js
- Using
assets/js/components/legacy-notifications/site/mark-notification.js
,- Remove the current
trackEvent
call within themarkNotification
function.
- Remove the current
- Using
assets/js/components/legacy-notifications/notification.js
,- Within the
useMount
hook, calltrackEvent
, withview_notification
as action. - Update the
handleCTAClick
function to calltrackEvent
withconfirm_notification
as action. - Update the
handleDismiss
function to calltrackEvent
withdismiss_notification
as action. - Add the
onClick
prop to theLink
component for the “Learn More” label and the callback function should calltrackEvent
withclick_learn_more_link
as action. - All of the above events should use
dashboard_site-notification
as event category and the notificationid
as label.
- Within the
Test Coverage
- No new test to be added.
QA Brief
- GA Tracking Events for Notification should fire according to AC with
dashboard_site-notification
(AC is Outdated, see IB) category and notification ID as the Label. - Use Google Analytics Debugger to verify.
Changelog entry
- N/A
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Event tracking in Google Analytics | Fomo Help Center
Event tracking in Google Analytics ... Your website visitor clicks a Fomo notification. GA event "fires" and is visible inside your Analytics portal....
Read more >[GA4] Automatically collected events - Analytics Help
Automatically collected events are triggered by basic interactions with your app and/or site (as indicated under the event name in the table below)....
Read more >Use Google Analytics Events to track how many times ...
Use Google Analytics Events to track how many times PushCrew opt-in for web notifications was displayed. Google Analytics. Web push ...
Read more >Google Analytics - OneSignal Documentation
The easiest way to track notification clicks is to add Google Analytics UTM ... method to send an event to Google Analytics from...
Read more >Log events | Google Analytics for Firebase
Web Flutter. This guide shows you how to log events in your app. Events provide insight on what is happening in your app,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@felixarntz I don’t think we use it for any client notifications right now, but the functionality is there for it, so we didn’t want to introduce assumptions that might cause problems later 😄
QA ✅
Confirmed, event tracking fired correctly: