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
...@@ -156,12 +156,13 @@ export function reportWebVitals(metric) { ...@@ -156,12 +156,13 @@ 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:
> 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
> nonInteraction: true, // avoids affecting bounce rate. > 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