Skip to content

Commit d6d806e

Browse files
Rust-Trendsclaude
andcommitted
Improve Google Analytics error handling for better UX
- Add onerror handler to Google Tag Manager script loading - Provides informative console message when GA is blocked by ad blockers - Reduces confusion about "script loading failed" errors in developer console - Maintains full analytics functionality when scripts load successfully 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c9ea9c6 commit d6d806e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

themes/apollo/templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% include "partials/header.html" %}
66

77
<!-- Google tag (gtag.js) -->
8-
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FWPL9RWX77"></script>
8+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FWPL9RWX77" onerror="console.log('Google Analytics blocked by ad blocker or privacy settings')"></script>
99
<script>
1010
window.dataLayer = window.dataLayer || [];
1111
function gtag(){dataLayer.push(arguments);}

0 commit comments

Comments
 (0)