Chrome is phasing out the browser unload event. Older Pendo web applications rely on that event to send the last batch of data when a visitor leaves a page. If your application was created before Pendo switched the default, turn on the Use visibility API instead of unload event setting so that Pendo keeps collecting complete data in Chrome. Applications created in recent years already have this setting on.
What changes in Chrome
The Pendo web SDK batches events in the browser and sends them on a timer: guide events about 500 ms after they happen, and click, focus, change, and Track Events up to every 2 minutes. When a visitor closes the tab or navigates to another page, the SDK sends whatever hasn't been sent yet. Older applications trigger that final send from the unload event.
Chrome is disabling the unload event in stages, so a growing share of page loads no longer fire it. On those page loads, events that haven't been sent yet are lost. You might notice:
- Fewer clicks and guide events than expected, especially on buttons that navigate to another page.
- Multi-step guides in iframes that don't show the next step.
- The browser console message
Permissions policy violation: unload is not allowed in this document.
Other browsers aren't affected yet. Pendo doesn't change settings on a working installation automatically, so applications set up before the default changed keep using the unload event until you update them.
Turn on the visibility API setting
With this setting on, the web SDK sends unsent events when the page is hidden instead of when it unloads. You must be a subscription admin or an App Admin for the application.
- Go to Settings > Subscription settings and open the Applications tab.
- Open the application and, in the App Details tab, find Engineer settings.
- Turn on Use visibility API instead of unload event.
Repeat this for each web application in your subscription. The change takes effect the next time the web SDK loads; you don't need to change your install script or redeploy your application.
If you self-host the web SDK, download a new copy from Web SDK Settings after turning the setting on. For more information, see Self-hosting the Pendo Web SDK.
Note: With this setting on, some browsers don't keep the page in the back-forward cache, so navigating with the browser's back and forward buttons can be slightly slower. The setting doesn't work on legacy browsers that lack the page visibility API.
Check which setting your application uses
Open the application's settings as described above and look at the Use visibility API instead of unload event toggle. If you self-host the web SDK, you can also look for preventUnloadListener in your downloaded pendo.js file: true means the setting is on.