Unverified Commit ec38b0f0 authored by Houssein Djirdeh's avatar Houssein Djirdeh Committed by GitHub

Minor update to "Measuring performance" docs (#12741)

parent 6d1167ee
...@@ -156,7 +156,7 @@ export function reportWebVitals(metric) { ...@@ -156,7 +156,7 @@ export function reportWebVitals(metric) {
> ```js > ```js
> export function reportWebVitals({ id, name, label, value }) { > export function reportWebVitals({ id, name, label, value }) {
> ga('send', 'event', { > ga('send', 'event', {
> eventCategory: `Next.js ${ label } metric`, > eventCategory: label === 'web-vital' ? 'Web Vitals' : 'Next.js custom metric',
> eventAction: name, > eventAction: name,
> eventValue: Math.round(name === 'CLS' ? value * 1000 : value), // values must be integers > eventValue: Math.round(name === 'CLS' ? value * 1000 : value), // values must be integers
> eventLabel: id, // id unique to current page load > eventLabel: id, // id unique to current page load
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment