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.

Trigger the custom GA `view_notification` event only when the banner notifications are visible

See original GitHub issue

Bug Description

Currently, some banner notifications trigger the custom GA view_notification event using the useMount hook. However, the view_notification event will be triggered even if the banner notification is not displayed due to the respective component returning null if the data is unavailable.

The above event should be triggered if the respective banner notification is displayed.

Steps to reproduce

  1. Go to the Site Kit dashboard.
  2. Ensure the Google Analytics Debugger is enabled.
  3. Open the dev tools->console and filter by view_notification.
  4. Notice some GA events are triggered even though respective banner notifications aren’t displayed. For example, mainDashboard_wp52-version-notification is triggered.

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Test Coverage

  • No new tests needed.

QA Brief

  • Install Site Kit via the plugin directory and activate it. Ensure the view_notification GA event for the activation category is triggered only when the ActivationApp notification is displayed. (This notification will have the Congratulations, the Site Kit plugin is now activated. title).
  • Ensure the view_notification GA event for the mainDashboard_wp52-version-notification event category is triggered only when the WPVersionBumpNotification is displayed.
  • Ensure the following events are triggered only when the SetupSuccessBannerNotification is displayed:
    • view_notification - mainDashboard_authentication-success-notification
    • complete_user_setup - mainDashboard_authentication-success-notification
    • complete_site_setup - mainDashboard_authentication-success-notification

Changelog entry

  • Fix bug that could cause a notification view event to be sent even when the notification doesn’t appear.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
techanvilcommented, Nov 4, 2022

Good spot there @aaemnnosttv. I have looked into this and it’s not a regression as I can see the same behaviour in the previous release. I’ve created a followup issue to address this: https://github.com/google/site-kit-wp/issues/6109

1reaction
eugene-manuilovcommented, Oct 24, 2022

Thanks, @tofumatt. Could you please add more information to IB? I think that each components have different circumstances when we can consider them as rendered, right? Let’s write them down in IB.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create and manage custom alerts - Analytics Help
Create custom alerts · Sign in to Google Analytics. · Navigate to your view. · Open Reports. · Click CUSTOMIZATION > Custom Alerts....
Read more >
A User's Guide to Google Analytics Custom Alerts - The Good
Custom alerts tell Google Analytics to send notifications (email or text) when signals you've predetermined on your website are triggered.
Read more >
Custom Alerts in Google Analytics 4 - (The Complete Guide)
In GA4, custom alerts are called Custom Insights. Learn what's new, how to set them up and how to put insight notifications at...
Read more >
Change notification settings on iPhone - Apple Support (JO)
Go to Settings > Notifications. Choose how you want notifications displayed on the Lock Screen: View just the number of notifications: Tap Count....
Read more >
The Element Visibility Trigger In Google Tag Manager
What do you mean? Custom Dimensions don't exist outside hits sent to GA, and a hit sent to GA requires a tag such...
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