Skip to content

Commit 6b13239

Browse files
Testwarp-agent
andcommitted
Add Google Analytics tracking to website
Configure GA4 tracking for gptcode.cloud with measurement ID G-PBKPBY1N9H. Analytics will only load in production environment. Co-Authored-By: Warp <agent@warp.dev>
1 parent f626091 commit 6b13239

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

docs/_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ highlighter: rouge
1818
timezone: America/Sao_Paulo
1919
future: false
2020

21+
google_analytics: G-PBKPBY1N9H
22+
2123
plugins:
2224
- jekyll-feed
2325
- jekyll-seo-tag

docs/_layouts/default.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
<link
1818
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
1919
rel="stylesheet">
20+
21+
{% if site.google_analytics and jekyll.environment == 'production' %}
22+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
23+
<script>
24+
window.dataLayer = window.dataLayer || [];
25+
function gtag(){dataLayer.push(arguments);}
26+
gtag('js', new Date());
27+
gtag('config', '{{ site.google_analytics }}');
28+
</script>
29+
{% endif %}
2030
</head>
2131

2232
<body>

0 commit comments

Comments
 (0)