Skip to content

Commit

Permalink
Merge branch 'main' of github.com:HTTPArchive/almanac.httparchive.org…
Browse files Browse the repository at this point in the history
… into production
  • Loading branch information
tunetheweb committed Jun 10, 2024
2 parents 4538b65 + 523ae0d commit a76ab9f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/config/last_updated.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
},
"/static/js/send-web-vitals.js": {
"date_published": "2021-02-24T00:00:00.000Z",
"date_modified": "2024-06-05T00:00:00.000Z",
"hash": "93b415ccbc2d2f5de8627d6019546f09"
"date_modified": "2024-06-10T00:00:00.000Z",
"hash": "b7224f484fe762e075d4838286ddb066"
},
"/static/js/web-vitals.js": {
"date_published": "2020-11-13T00:00:00.000Z",
"date_modified": "2024-06-05T00:00:00.000Z",
"hash": "10638eba1611ff0dc07edbe721e3eb45"
"date_modified": "2024-06-10T00:00:00.000Z",
"hash": "fd1e29002e3518e8bf128dbbddaecc07"
},
"/static/js/webmentions.js": {
"date_published": "2021-12-01T00:00:00.000Z",
Expand Down
14 changes: 7 additions & 7 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"run-script-os": "1.1.6",
"showdown": "2.1.0",
"smartypants": "0.2.2",
"web-vitals": "4.0.1",
"web-vitals": "4.1.0",
"xml-js": "1.6.11"
}
}
7 changes: 6 additions & 1 deletion src/static/js/send-web-vitals.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function sendWebVitals() {
}));
}

function sendWebVitalsGAEvents({name, delta, id, attribution, navigationType}) {
function sendWebVitalsGAEvents({name, delta, value, id, attribution, navigationType}) {

let overrides = {};

Expand Down Expand Up @@ -136,6 +136,11 @@ function sendWebVitals() {
event_category: 'Web Vitals',
value: Math.round(name === 'CLS' ? delta * 1000 : delta),
event_label: id,
// Repeat with new fields to match web-vitals documentation
// TODO deprecate above names when no longer required
metric_value: Math.round(name === 'CLS' ? value * 1000 : value),
metric_delta: Math.round(name === 'CLS' ? delta * 1000 : delta),
metric_id: id,
non_interaction: true,
effective_type: effectiveType,
data_saver: dataSaver,
Expand Down

0 comments on commit a76ab9f

Please sign in to comment.