Skip to content

🙏 User consent impacts loading-time metric #3679

@iwb-lvd

Description

@iwb-lvd

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 startView only after the user accepts consent — this didn’t help, the loading-time is still impacted.
  • Calling startView again after consent — same result, plus it results in duplicate views (which is expected).
  • Using the experimental feature flag enableExperimentalFeatures: ['dom_mutation_ignoring'] along with data-dd-excluded-activity-mutations on the consent element — no improvement.
  • Using excludedActivityUrls to ignore the API call used for consent validation — no effect either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions