Skip to content

Web Vitals segmentation #14

@adamhenson

Description

@adamhenson

Summary

Provide a new field from the API endpoint to allow users to specify segmentation. Below would be the diff of the JavaScript example documented here.

const body = JSON.stringify({
  accountId: YOUR_ACCOUNT_ID,
  name: metric.name,
+  segmentation: ['logged-in', 'premium-subscribed'],
  url: window.location.href,
  value: metric.value,
});

return (
  (navigator.sendBeacon && navigator.sendBeacon(VITALS_URL, body)) ||
  fetch(VITALS_URL, {
    body,
    method: 'POST',
    keepalive: true,
    headers: {
      'Content-Type': 'application/json',
    },
  })
);

In the Web Vitals dashboard we could present a checklist of all segmentations that have been sent. In the example above, the user would have 3 checkboxes for segmentation: none, logged-in, and premium-subscribed. By default, all 3 would be checked. If only logged-in was checked, we would only show data for metrics that had this value of the segmentation array sent with it.

Value

This would provide users the ability to analyze page experience (Web Vitals) as part of A/B test experiments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AcceptedAccepted feature request. This feature will be implemented.Q1 2022

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions