question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement/refactor GA tracking events for remote site notifications

See original GitHub issue

Feature 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 and dismissed events around site notifications should be removed.

Implementation Brief

  • trackEvent mentioned in the bullet points below should be imported from assets/js/util/tracking/index.js
  • Using assets/js/components/legacy-notifications/site/mark-notification.js,
    • Remove the current trackEvent call within the markNotification function.
  • Using assets/js/components/legacy-notifications/notification.js,
    • Within the useMount hook, call trackEvent, with view_notification as action.
    • Update the handleCTAClick function to call trackEvent with confirm_notification as action.
    • Update the handleDismiss function to call trackEvent with dismiss_notification as action.
    • Add the onClick prop to the Link component for the “Learn More” label and the callback function should call trackEvent with click_learn_more_link as action.
    • All of the above events should use dashboard_site-notification as event category and the notification id as label.

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:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aaemnnosttvcommented, Sep 29, 2021

For which client notifications is this store actually currently used, if any?

@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 😄

0reactions
ivankruchkoffcommented, Oct 19, 2021

QA ✅

Confirmed, event tracking fired correctly:

https://www.google-analytics.com/collect?v=1&_v=j93&a=139XXXXXXX&t=event&_s=3&dl=http://sitekit.10uplabs.com/wp-admin/admin.php?page=googlesitekit-dashboard&ul=en-us&de=UTF-8&dt=Site Kit by Google Dashboard ‹ sitekit — WordPress&sd=24-bit&sr=1440x900&vp=1425x256&je=0&ec=dashboard_site-notification&ea=view_notification&el=googlesitekit-error&_u=aADAAUABAAAAAC~&jid=&gjid=&cid=863XXXXXX.XXXX6XXXX0&tid=UA-XXXXXXXXX-3&_gid=2XXXXXXXXX.XXXXXXXXXX&gtm=2XXXX0&cd1=http://sitekit.10uplabs.com&cd2=true&cd3=XXXXXXXXXXXXXXXXX&cd4=1.43.0&cd5=&z=22697XXXX
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found