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

Explore replacing existing GA tags with CKAN-supported Google Tag Manager #4633

Closed
4 of 6 tasks
tdlowden opened this issue Feb 26, 2024 · 4 comments
Closed
4 of 6 tasks
Assignees
Labels
GA google analytics

Comments

@tdlowden
Copy link
Member

tdlowden commented Feb 26, 2024

User Story

In order to more easily manage google analytics tags and custom analytics, datagov team members want to implement Google Tag Manager (GTM).

Acceptance Criteria

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

  • GIVEN CKAN can support using GTM
    AND the team has a desire to manage analytics tags without touching site code
    WHEN a pageload happens
    THEN Google Tag Manager will fire and collect data to send to the datagov and DAP GA accounts \

Background

For the work we'd like to do to customize Google Analytics to track specific downloads, button clicks, or capture publisher to create more meaningful metrics, getting GTM in place would allow Tim and/or other less technical team members to use the GTM interface to create custom triggers or send data to the dataLayer.

This appears to be supported by CKAN https://github.com/ckan/ckanext-googleanalytics/blob/24d9a7ff62235bc2d543e6594f7362763411b0f9/ckanext/googleanalytics/templates/googleanalytics/snippets/_gtm.html

Security Considerations (required)

Will need to potentially add to SSPP/ATO docs.

The GTM account permissions should be well-managed and documented so that no unwanted parties can access.

Sketch

  • Research if GTM is supported by CKAN
  • Set up GA tags in GTM
  • Add GTM tags to dev environment
  • Use GTM debugger to check if firing
  • Confirm traffic in datagov and DAP GA accounts
@tdlowden tdlowden added the GA google analytics label Feb 26, 2024
@tdlowden
Copy link
Member Author

tdlowden commented Mar 8, 2024

GTM ID: GTM-WZJC8CX7

@dlennox24 are you able to try pushing this to dev sometime Monday?

@dlennox24
Copy link

@tdlowden Yes! Working PR is available here: GSA/ckanext-datagovtheme#187

@tdlowden
Copy link
Member Author

tdlowden commented Mar 12, 2024

Can confirm GTM is firing on dev. Right now, I have the data.gov GA4 tag paused, because when we push to prod, we'll need to remove the existing <script> tag at the same time I make the GTM tag active.

image

@tdlowden
Copy link
Member Author

an aspect of this I forgot to document is that we need to remove the existing <script> tag from catalog (or anywhere this GTM container is being implemented) because I created the GA tag from within the GTM interface to be fired from the container. @dlennox24 I spoke with @FuhuXia and he is going to push the container to prod, but I'll leave the GA tag in GTM paused. Then you and I can coordinate to remove the existing script and simultaneously turn on the GTM tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GA google analytics
Projects
Archived in project
Development

No branches or pull requests

2 participants