Skip to content

Commit a3414c3

Browse files
committed
refactor: gtag
Signed-off-by: Adam Setch <[email protected]>
1 parent 3f06c2e commit a3414c3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
---
2+
import { siteMetadata } from '../constants.ts';
3+
4+
const GTAG_ID = siteMetadata.google.gtag;
5+
const GTAG_SRC = `https://www.googletagmanager.com/gtag/js?id=${GTAG_ID}`;
6+
---
17
<!-- Google tag (gtag.js) -->
2-
<script
3-
async
4-
src="https://www.googletagmanager.com/gtag/js?id=G-QXML81DEDV"
5-
></script>
8+
<script async src={GTAG_SRC}></script>
69
<script>
710
window.dataLayer = window.dataLayer || [];
811
function gtag() {
@@ -11,5 +14,5 @@ function gtag() {
1114
}
1215
gtag('js', new Date());
1316

14-
gtag('config', 'G-QXML81DEDV');
17+
gtag('config', GTAG_ID);
1518
</script>

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const siteMetadata = {
1414
keywords:
1515
'gitify,desktop,application,github,notifications,unread,menu bar,electron,open source,mac,windows,linux',
1616
google: {
17+
gtag: 'G-QXML81DEDV',
1718
siteVerification: 'jJNnPZ2wu7F1tlSab57og1N3RNrMqhzTCzRrbztY8WU',
1819
},
1920
menuLinks: [

0 commit comments

Comments
 (0)