Braze Banners System Layout fixes & Observability#15485
Open
andresilva-guardian wants to merge 10 commits intomainfrom
Open
Braze Banners System Layout fixes & Observability#15485andresilva-guardian wants to merge 10 commits intomainfrom
andresilva-guardian wants to merge 10 commits intomainfrom
Conversation
…ner and close-button
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
This PR delivers two groups of improvements to
BrazeBannersSystem:1. Layout & Scroll Fixes (Wrapper Mode)
border: noneoverride that was applied at the phablet breakpoint — the banner now has a consistentborder-topat all screen sizes.overflow-y: autoandoverflow-x: hiddento the wrapper container, allowing taller banners to scroll vertically within themax-height: 65svhconstraint on portrait/small screens.overscroll-behavior: noneto prevent scroll chaining — once the user reaches the top or bottom of the banner, the scroll event is no longer propagated to the host page.copy-container / close-buttonlayout: changedauto 0px→100% 0pxsocopy-containeralways occupies the full available width.2. Observability: Impression Tracking & Interaction Logging
Impression Tracking (on first view)
The
BrazeBannersSystemDisplaycomponent now uses theuseIsInViewhook to detect when the banner first enters the viewport. On that event, three things happen in sequence:The
ophanComponentIdcan be overridden per campaign via a Key-Value pair in the Braze Dashboard; it falls back toplacementId.Interaction Logging (on user action)
Every user interaction now logs both a Braze banner click (for native Braze campaign reports) and a Braze custom event (for granular analytics):
logBannerClicklabellogCustomEventnamenewsletter_subscribe_buttonbraze_banner_newsletter_subscribeplacementId,newsletterId,successreminder_subscribe_buttonbraze_banner_reminder_subscribeplacementId,reminderPeriod,reminderComponent,reminderOption,successnavigate_to_url_buttonbraze_banner_navigate_to_urlplacementId,url,targetdismiss_buttonbraze_banner_dismissedplacementIdCSS Validation Failure Logging
runCssCheckerOnBrazeBannernow returns a boolean result. If validation fails:brazeBannersSystemLogger.warn(...)is called so it's visible in DCR logs.braze_banner_css_validation_failedis fired withplacementId.idpropagated through the systemcanShowBrazeBannersSystemnow accepts an explicitidstring (the message picker candidate ID) and surfaces it throughBrazeBannersSystemMeta. Thisidis used asbannerIdin thebanner:openDOM event, enabling precise identification of which candidate fired.Why?
Layout fixes
Banners on portrait tablets (phablet breakpoint) were overflowing their container because no scroll affordance existed. The inconsistent
border: noneat phablet also caused a visual discontinuity with other breakpoints. These are straightforward correctness fixes.Observability
The Braze Banners System was previously a black box from an analytics standpoint — we had no reliable signal for:
This PR fills all three gaps:
Screenshots
No relevant screen changes to display.