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

Refactor how GA shared ID is added to the pages #787

Open
wants to merge 1 commit into
base: 11.x
Choose a base branch
from

Conversation

pookmish
Copy link
Contributor

@pookmish pookmish commented Apr 8, 2024

READY FOR REVIEW

Summary

  • Refactor how the shared GA is added to the sites.

Setup tasks and/or behavior to test

  1. Check out this branch
  2. comment out $config['google_analytics.settings']['account'] = ''; in the google_analytics.settings.php file
  3. clear your caches
  4. view the site as anonymous in chrome
  5. verify no console errors from GA.
  6. verify the shared tracking code is loading.
  7. Add a GA via site settings /admin/config/system/basic-site-settings
  8. view the site as anonymous in chrome
  9. verify no console errors from GA.
  10. verify the shared tracking code and the one you entered is loaded on the page.

@pookmish pookmish changed the title ' Refactor how GA shared ID is added to the pages Apr 8, 2024
@pookmish pookmish force-pushed the refactor-shared-analytics branch 2 times, most recently from 48386ca to 0165a30 Compare April 8, 2024 21:50
@pookmish pookmish requested a review from sherakama April 8, 2024 21:55
@pookmish pookmish force-pushed the refactor-shared-analytics branch from 0165a30 to dd56420 Compare April 8, 2024 22:14
Comment on lines +121 to +123
// Only add Google Analytics for anonymous users or users without editing
// access while on Acquia environment. Being able to view the toolbar is a
// good indicator that they can edit some part of the site.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pookmish thanks for these changes.
@buttonwillowsix, does this logic match how we are using our GA tracking code?

Would this opt-out most users on the intranet sites?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pookmish
Copy link
Contributor Author

gentle poke. no rush

@sherakama
Copy link
Member

gentle poke. no rush

Code works and makes sense to me. Just looking to @buttonwillowsix to confirm intent or business case alignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants