-
Notifications
You must be signed in to change notification settings - Fork 164
Description
Hello 👋
(If you need more context, do not hesitate to ask)
What are you trying to achieve and what is your issue? Please describe.
We are using RUM in our application along with Usercentrics to manage user consent. A consent popup is displayed when the page loads. Once the user clicks the "Accept" button, we call rum.setTrackingConsent() to enable tracking.
Everything works fine, however, we noticed that the loading-time metric is unusually high. After testing several scenarios, it appears that if the user takes time to accept the consent popup, the loading-time metric is affected. In other words, loading-time seems to be measured up to the moment the user gives consent, rather than when the page is actually loaded.
Note: LCP, FCP, and other metrics are not impacted by this issue, and shows good values.
Describe the solution you'd like
We’re not exactly sure what the right solution should be, but ideally, the loading-time metric should reflect when the page is actually loaded, and not be delayed until the user gives consent.
Describe alternatives you've considered
We’ve tried several workarounds, but none have worked so far:
- Calling
startViewonly after the user accepts consent — this didn’t help, theloading-timeis still impacted. - Calling
startViewagain after consent — same result, plus it results in duplicate views (which is expected). - Using the experimental feature flag
enableExperimentalFeatures: ['dom_mutation_ignoring']along withdata-dd-excluded-activity-mutationson the consent element — no improvement. - Using
excludedActivityUrlsto ignore the API call used for consent validation — no effect either.