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

GA not recording org and publisher correctly #4743

Closed
3 tasks
tdlowden opened this issue May 8, 2024 · 9 comments
Closed
3 tasks

GA not recording org and publisher correctly #4743

tdlowden opened this issue May 8, 2024 · 9 comments
Assignees
Labels
bug Software defect or bug

Comments

@tdlowden
Copy link
Member

tdlowden commented May 8, 2024

After implementing CSS Selectors to collect organization and publisher (when present), GA is showing that the implementation worked, but it is recording those variables for some pageviews and not all.

Image

How to reproduce

  1. Log into datagovGA4
  2. Create a report to show datagov_dataset_organization
  3. Filter by a specific dataset URL
  4. witness the variance in organization and (not set)

Expected behavior

100% of dataset pageviews will attribute a datagov_dataset_organization and a datagov_dataset_publisher. Each dataset page will contain one value per variable, and not a value and also (not set) for some pageviews.

Actual behavior

~60% of pageviews record an org and publisher, and ~40% record (not set)

Sketch

  • Research activity to determine issue or if it is related to bots
  • Make necessary changes
  • Validate changes work in GA
@tdlowden tdlowden added the bug Software defect or bug label May 8, 2024
@gujral-rei gujral-rei moved this to 📔 Product Backlog in data.gov team board May 9, 2024
@tdlowden
Copy link
Member Author

New goal: Have the organization and publisher drawn from CKAN directly to populate a dataLayer array upon pageload, like usa.gov does:

Image

This would apply on all pages related to a dataset, for example:

Should all have the same array with organization set to State of Washington and publisher set to data.wa.gov

This tutorial should help: https://www.analyticsmania.com/post/ultimate-google-tag-manager-data-layer-tutorial/

From there, I can use GTM dataLayer variables to collect the data and send on pageviews and file downloads to GA, to associate those events with the org.

@tdlowden tdlowden moved this from 📔 Product Backlog to 📟 Sprint Backlog [7] in data.gov team board Jun 6, 2024
@tdlowden tdlowden moved this from 📟 Sprint Backlog [7] to 🏗 In Progress [8] in data.gov team board Jun 17, 2024
@tdlowden
Copy link
Member Author

@robert-bryson any updates here?

@gujral-rei
Copy link

@robert-bryson , please update the ticket.

@robert-bryson
Copy link
Contributor

The current approach (JS Google Tag Manger script) is the recommended by Tag Manager but not working for us, obviously. There is a way to generate it via an official server-side tagging option. The docs describe a very different scenario than what is presented above so I am working on achieving the above with the official functionality if possible.

@robert-bryson
Copy link
Contributor

Draft PR at GSA/ckanext-datagovtheme#204.

@tdlowden
Copy link
Member Author

tdlowden commented Jul 8, 2024

FYI:

#4783 (comment)

Thanks to @jbrown-xentity for a quick fix PR

@tdlowden
Copy link
Member Author

@robert-bryson added

window.dataLayer = window.dataLayer \|\| [];
--
  |  
  | dataLayer.push({

which resolved the GTM issue. Moving to blocked until pentesting is done so we can push to prod

@tdlowden tdlowden moved this from 🏗 In Progress [8] to 📡 Blocked in data.gov team board Jul 10, 2024
jbrown-xentity added a commit to GSA/catalog.data.gov that referenced this issue Jul 15, 2024
@tdlowden
Copy link
Member Author

Pushed to prod. Subject to data populating, will QA Wednesday

@tdlowden tdlowden moved this from 📡 Blocked to 🏗 In Progress [8] in data.gov team board Jul 16, 2024
@tdlowden
Copy link
Member Author

as of 7/17, we now have 98% accuracy. Not perfect, but well within a margin of error for bots that I feel comfortable with making the data public

Image

@github-project-automation github-project-automation bot moved this from 🏗 In Progress [8] to ✔ Done in data.gov team board Jul 17, 2024
@hkdctol hkdctol moved this from ✔ Done to 🗄 Closed in data.gov team board Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Software defect or bug
Projects
Archived in project
Development

No branches or pull requests

3 participants