Performance tools such as Lighthouse or PageSpeed Insights may report Cumulative Layout Shift (CLS) attributed to the Pushwoosh subscription prompt. This happens when the prompt is inserted into the page while content is still settling, pushing surrounding elements around.
If you use the custom subscription popup (Web SDK)
The prompt is configured through the subscribePopup object in your Pushwoosh Web SDK init call. The relevant parameters are:
-
delay— seconds between page load and the popup appearing. Raising this past the point where your layout has stabilised keeps the shift out of the CLS measurement window. -
manualToggle— set totrueto stop the popup appearing on its own, then show it yourself in response to a user action (for example, a click on your own "Get notifications" button). Shifts within 500 ms of a user interaction are excluded from CLS. -
overlay— set totrueso the popup is drawn over the page instead of interacting with the surrounding flow. -
position—'top','center'or'bottom'. A'center'or'bottom'overlay disturbs the main content flow less than a banner at the top. -
retryOffset— seconds before the popup is shown again after "Ask later" (default 604800, one week).
Pushwoosh.push(['init', {
// ...
subscribePopup: {
enable: true,
delay: 60,
manualToggle: false,
overlay: true,
position: 'bottom'
}
}]);
If you use the default widget
Configure it at Settings > Configure platforms > Web push notification > Subscription prompt, then click Settings. Note that the default widget already limits itself: if a user denies or ignores it, it reappears after 4 hours and is capped at 3 total impressions.
Trade-off: changing the trigger from automatic display to requiring a user interaction, or adding a long delay, will normally reduce the number of push subscribers you collect. Measure opt-in rate alongside your CLS score rather than optimising one in isolation.
Learn more: Custom subscription popup
Comments
0 comments
Please sign in to leave a comment.