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 Google Analytics script for current GA4 compatibility #835

Closed
wants to merge 1 commit into from

Conversation

BenU
Copy link

@BenU BenU commented Jan 23, 2025

Thank you for maintaining Minima and making it such a great theme for the Jekyll community! I really appreciate the effort that goes into keeping this project useful for so many.

This pull request updates the outdated Google Analytics script in _includes/google-analytics.html, which currently uses the Universal Analytics format. The old script is incompatible with Google Analytics 4 (GA4) and no longer works with GA4 tracking IDs.

Key changes:

  • Replaced the Universal Analytics script with the recommended GA4 script from Google.
  • Retained the use of {{ site.google_analytics }} to dynamically pull the tracking ID from _config.yml, maintaining Minima’s current behavior.

Why this change is necessary:

  • The current script does not function with GA4 tracking IDs, leaving users without analytics data if they’ve migrated to GA4 or starting a new project with GA4.
  • This update ensures Minima supports modern Google Analytics implementations.

Testing:

  • I’ve tested this updated script in production with a GA4 tracking ID, and it works as expected.

Please let me know if there’s anything else I can do to assist with this contribution. Thanks again for your work on this project!

@ashmaroli
Copy link
Member

Thank you for submitting a pull request, @BenU. However, this can only be considered a duplicate of prior art at #825.

@BenU
Copy link
Author

BenU commented Jan 23, 2025

Thank you for pointing out the redundancy! After reviewing the other PRs, I see that this one overlaps with their solutions (#824 and #825). I'll close this PR to avoid duplication.

I really appreciate the work of the maintainers and contributors on this project, and I’ll make sure to check existing issues and PRs more thoroughly before submitting next time. Thanks again for your time and for maintaining Minima! (This is my first PR!)

@BenU BenU closed this Jan 23, 2025
@BenU BenU deleted the update-google-analytics-script branch January 23, 2025 14:44
@ashmaroli
Copy link
Member

I am sorry that you had to prematurely close your first pull request to this project. I hope that does not discourage you from further submitting pull requests to this project.

Feel free to propose changes as you feel the need. The only advice is to avoid requesting to merge additional social-media-icons.

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

Successfully merging this pull request may close these issues.

2 participants