Page MenuHomePhabricator

[e.cash] Add google analytics script
ClosedPublic

Authored by johnkuney on Jul 19 2023, 17:34.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABCb2c8bc45ef51: [e.cash] Add google analytics script
Summary

Adding the google analytics scripts as outlined here https://nextjs.org/docs/messages/next-script-for-ga
And adding a .env file to store the GA ID as outlined here https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables

Test Plan

preview the site and check the scripts are loading properly

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bytesofman requested changes to this revision.EditedJul 19 2023, 17:43
bytesofman added a subscriber: bytesofman.

With GA4, the ID we need here is different from the property ID. Here's the <script> from our analytics dashboard:

<!-- Google tag (gtag.js) -->
<script async src=`https://www.googletagmanager.com/gtag/js?id=${GOOGLE_ANALYTICS_ID}`></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', GOOGLE_ANALYTICS_ID);
</script>
This revision now requires changes to proceed.Jul 19 2023, 17:43
johnkuney edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Jul 19 2023, 21:39
This revision was automatically updated to reflect the committed changes.