Skip to content

v1.1.3

Choose a tag to compare

@breonwilliams breonwilliams released this 18 Apr 21:33
· 2 commits to main since this release

Fix Google tag detection by outputting script in head with async attribute.

Changes:

  • Output gtag script directly in <head> at priority 1 instead of using WordPress enqueue system
  • Use standard async attribute instead of data-wp-strategy="async"
  • Script now matches Google's expected format exactly

Before:

<script src="https://www.googletagmanager.com/gtag/js?id=G-..." id="mga4-gtag-js" data-wp-strategy="async"></script>

After:

<script async src="https://www.googletagmanager.com/gtag/js?id=G-..."></script>

This resolves the "Your Google tag wasn't detected on your website" error in Google Analytics.