Unverified Commit e91c0fcc authored by Sergio Xalambrí's avatar Sergio Xalambrí Committed by GitHub

Add missing parenthesis in Sending results to analytics example (#12733)

parent ec38b0f0
...@@ -155,13 +155,14 @@ export function reportWebVitals(metric) { ...@@ -155,13 +155,14 @@ 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: label === 'web-vital' ? 'Web Vitals' : 'Next.js custom metric', > eventCategory:
> eventAction: name, > label === 'web-vital' ? 'Web Vitals' : 'Next.js custom metric',
> eventValue: Math.round(name === 'CLS' ? value * 1000 : value), // values must be integers > eventAction: name,
> eventLabel: id, // id unique to current page load > eventValue: Math.round(name === 'CLS' ? value * 1000 : value), // values must be integers
> nonInteraction: true, // avoids affecting bounce rate. > eventLabel: id, // id unique to current page load
> }, > nonInteraction: true, // avoids affecting bounce rate.
> })
> } > }
> ``` > ```
> >
......
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