Skip to content

Commit

Permalink
Merge pull request #268 from yoonghan/metric
Browse files Browse the repository at this point in the history
Send ga metric as int
  • Loading branch information
yoonghan authored Aug 29, 2024
2 parents 490fb8d + 891cf46 commit 02505df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/mocks/walcron-microfrontend-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jest.mock("@yoonghan/walcron-microfrontend-shared", () => {
reportWebVitals: (callback: any) => {
callback({
name: "CLS",
delta: 1,
delta: 1.1,
id: "test",
value: 2,
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/GoogleAnalytic/GoogleAnalytic.jest.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("Google Analytic", () => {
metric_delta: 1,
metric_id: "test",
metric_value: 2,
value: 1,
value: 1.1,
})

rerender(<GoogleAnalytic ga4Id={gaValue} />)
Expand Down
4 changes: 2 additions & 2 deletions src/components/GoogleAnalytic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export function GoogleAnalytic({ ga4Id }: Props) {
*/
reportWebVitals(({ name, delta, id, value }) => {
ReactGA.event(name, {
value: Math.floor(delta),
value: delta,
metric_id: id,
metric_value: value,
metric_delta: delta,
metric_delta: Math.floor(delta),
})
})
}, [ga4Id])
Expand Down

0 comments on commit 02505df

Please sign in to comment.