Skip to content

Commit

Permalink
Update to process.env (#1048)
Browse files Browse the repository at this point in the history
Co-authored-by: Chase Fleming <1666730+chasefleming@users.noreply.github.com>
  • Loading branch information
chasefleming and chasefleming authored Dec 13, 2024
1 parent 10245c9 commit bcd9654
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/gtags.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare global {
* https://developers.google.com/analytics/devguides/collection/gtagjs/pages
*/
export const pageview = (url: string, trackingId: string) => {
if (window.ENV.NODE_ENV !== "production") return
if (process.env.NODE_ENV !== "production") return

if (!window.gtag) {
console.warn(
Expand Down Expand Up @@ -43,7 +43,7 @@ export const event = ({
label?: string;
value?: number | string;
}) => {
if (window.ENV.NODE_ENV !== "production") return
if (process.env.NODE_ENV !== "production") return

if (!window.gtag) {
console.warn(
Expand All @@ -59,7 +59,7 @@ export const event = ({
}

export const reportWebVitalsToGA = (vitals: Metric) => {
if (window.ENV.NODE_ENV === "production") {
if (process.env.NODE_ENV === "production") {
window.gtag("event", vitals.name, {
...vitals,
value: vitals.delta, // Use `delta` so the value can be summed
Expand Down

0 comments on commit bcd9654

Please sign in to comment.