From 0e49b5e2adc3d7625c2475b2ae5b01a8eae27078 Mon Sep 17 00:00:00 2001 From: Christopher Joslyn Date: Wed, 3 Feb 2021 12:33:18 -0500 Subject: [PATCH] Match sendToAnalytics with web-vitals README Update sendToAnalytics example to match with https://github.com/GoogleChrome/web-vitals/pull/81 --- docusaurus/docs/measuring-performance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/measuring-performance.md b/docusaurus/docs/measuring-performance.md index a41635cbe40..3f19a2bed94 100644 --- a/docusaurus/docs/measuring-performance.md +++ b/docusaurus/docs/measuring-performance.md @@ -32,7 +32,7 @@ With the `reportWebVitals` function, you can send any of results to an analytics ```js function sendToAnalytics(metric) { - const body = JSON.stringify(metric); + const body = JSON.stringify({[metric.name]: metric.value}); const url = 'https://example.com/analytics'; // Use `navigator.sendBeacon()` if available, falling back to `fetch()`