Skip to content

Commit

Permalink
Update the GA4 usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
philipwalton committed Mar 12, 2021
1 parent 2674ccd commit 6268ad3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,11 @@ function sendToGoogleAnalytics({name, delta, value, id}) {
// Assumes the global `gtag()` function exists, see:
// https://developers.google.com/analytics/devguides/collection/ga4
gtag('event', name, {
// Use the metric delta as the event's value parameter.
value: delta,
// Everything below is a custom event parameter.
web_vitals_metric_id: id, // Needed to aggregate events.
web_vitals_metric_value: value, // Optional
// Built-in params:
value: value,
// Custom params:
metric_id: id, // Needed to aggregate events.
metric_delta: delta, // Optional
// Any additional params or metadata (e.g. debug information) can be
// set here as well, within the following limitations:
// https://support.google.com/analytics/answer/9267744
Expand Down

0 comments on commit 6268ad3

Please sign in to comment.