Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update data.gov Google Analytics tag (analytics.js) to the GA4 (gtag.js) #3571

Closed
7 tasks done
FuhuXia opened this issue Dec 2, 2021 · 13 comments
Closed
7 tasks done
Assignees
Labels
metrics Stats, metrics and data visualizations of catalog

Comments

@FuhuXia
Copy link
Member

FuhuXia commented Dec 2, 2021

User Story

In order to benefit from the new generation of Google Analytics, data.gov teams wants upgrade to Google's GA4 (gtag.js) tagging solution.

Acceptance Criteria

[ACs should be clearly demoable/verifiable whenever possible. Try specifying them using BDD.]

  • WHEN visit https://catalog.data.gov
    THEN we see https://www.googletagmanager.com/gtag/js in the source code
    AND visitor data are collected to the new GA4 properties on the GA dashboard.
  • WHEN visit https://www.data.gov
    THEN we see https://www.googletagmanager.com/gtag/js in the source code
    AND visitor data are collected to the new GA4 properties on the GA dashboard.
  • WHEN visit https://sdg.data.gov/
    THEN we see https://www.googletagmanager.com/gtag/js in the source code
    AND visitor data are collected to the new GA4 properties on the GA dashboard.
  • WHEN visit https://resources.data.gov/
    THEN we see https://www.googletagmanager.com/gtag/js in the source code
    AND visitor data are collected to the new GA4 properties on the GA dashboard.

Background

We got email notification from Google to encourage for the upgrade.

Security Considerations (required)

Developer will need to gain access to the GA dashboard to configure GA4 properties.

Sketch

  • Configure new GA4 properties on the GA dashboard.
  • Add gtag.js snippet to ckanext-googleanalyticsbasic ckan extensions for catalog.data.gov and static code to www.data.gov
  • Leave both old generation analytics.js snippet and new generation gtag.js snippet on for a while, verify it is working expected before taking analytics.js off.
@jbrown-xentity
Copy link
Contributor

Search analytics issues, there are 9 issues that are semi-related. Should validate this ticket with other possible work.

@hkdctol hkdctol moved this to Icebox in data.gov team board May 18, 2022
@hkdctol hkdctol moved this from Icebox to Product Backlog in data.gov team board May 18, 2022
@hkdctol hkdctol added this to the May 2023 milestone Oct 20, 2022
@hkdctol hkdctol moved this from 📔 Product Backlog to 📟 Sprint Backlog [7] in data.gov team board Oct 20, 2022
@hkdctol hkdctol moved this from 📟 Sprint Backlog [7] to 📔 Product Backlog in data.gov team board Oct 20, 2022
@btylerburton
Copy link
Contributor

Based on comments at the TTS Digital Council, we should first enroll in GSA's GA360 enterprise analytics program. This will give our UA implementation another year of life and then GA360 admins will create a GA4 account for us, after which developers can create implementation tickets.

@hkdctol hkdctol moved this from 📔 Product Backlog to 📟 Sprint Backlog [7] in data.gov team board Mar 16, 2023
@hkdctol hkdctol moved this from 📟 Sprint Backlog [7] to 📔 Product Backlog in data.gov team board Mar 16, 2023
@hkdctol hkdctol added the metrics Stats, metrics and data visualizations of catalog label Apr 11, 2023
@hkdctol
Copy link
Contributor

hkdctol commented May 11, 2023

Discussion at IRL was we update our own existing account and enroll in the GSA GA 360

@hkdctol hkdctol removed this from the May 2023 milestone May 11, 2023
@hkdctol hkdctol moved this to 📔 Product Backlog in data.gov team board May 11, 2023
@nickumia-reisys nickumia-reisys moved this from 📔 Product Backlog to 📟 Sprint Backlog [7] in data.gov team board May 25, 2023
@nickumia-reisys nickumia-reisys moved this from 📟 Sprint Backlog [7] to 📔 Product Backlog in data.gov team board May 25, 2023
@dlennox24 dlennox24 moved this from 📔 Product Backlog to 🏗 In Progress [8] in data.gov team board Sep 21, 2023
@FuhuXia
Copy link
Member Author

FuhuXia commented Sep 22, 2023

It turns out we lost the whole block <!-- Google Analytics --> ... <!-- End Google Analytics --> when we migrated from ckan 2.8.10 to 2.9.5 in August of 2022.

@dlennox24
Copy link

We determined that the CKAN templates were being overwritten by other CKAN plugins. Fuhu was able to resolve this with this PR: GSA/catalog.data.gov#1084. This likely also contributed to the lost of overall views in the GA reports. I've updated the PR with the GA4 tracking code. Once this is deployed we can verify if data is flowing into the GA4 property.

@dlennox24
Copy link

PR is merged and data from catalog.data.gov is flowing into the GA4 property. Next steps are to ensure static site data is being ingested into the GA4 property. This will likely require a separate data stream to allow for the difference in subdomains.

Image

@dlennox24
Copy link

Verified that the new gtag javascript was being used in the data.gov static site. I've update the tracking code to use the GA4 version. Once this is deployed, I can verify that data is flowing into the GA4 property from the static sites. Once that verification is complete, this story can be marked complete.

PR: GSA/datagov-11ty#158

Image

@dlennox24
Copy link

I verified that data is flowing into the GA4 from both catalog.data.gov and the 11ty site.

Examples:

@dlennox24 dlennox24 moved this from 🏗 In Progress [8] to 👀 Needs Review [2] in data.gov team board Oct 13, 2023
@hkdctol
Copy link
Contributor

hkdctol commented Oct 20, 2023

@dlennox24 what we discussed about making sure that sdg and resources are included in the Data.gov GA4, can we include that here, and then we can close ticket

@dlennox24 dlennox24 moved this from 👀 Needs Review [2] to 🏗 In Progress [8] in data.gov team board Oct 27, 2023
@dlennox24
Copy link

I added https://sdg.data.gov/ and https://resources.data.gov/ to the acceptance criteria and moved this back to in progress. These sites don't have the new GA4 tag/code added to them yet.

@dlennox24 dlennox24 moved this from 🏗 In Progress [8] to 👀 Needs Review [2] in data.gov team board Oct 27, 2023
@dlennox24
Copy link

I've added the new GA4 code to resources and sdg. The PRs are currently pending review and approval.

@hkdctol
Copy link
Contributor

hkdctol commented Nov 16, 2023

@dlennox24 will close after confirming data is flowing

@dlennox24
Copy link

Data has been flowing! Marking as complete.

Image

@github-project-automation github-project-automation bot moved this from 👀 Needs Review [2] to ✔ Done in data.gov team board Nov 30, 2023
@hkdctol hkdctol moved this from ✔ Done to 🗄 Closed in data.gov team board Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metrics Stats, metrics and data visualizations of catalog
Projects
Archived in project
Development

No branches or pull requests

5 participants