Skip to content

Commit eeb4020

Browse files
authored
feat: add g analytics (cairo-book#432)
1 parent 2e0e51b commit eeb4020

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

book.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ after = ["cairo"]
1818
git-repository-url = "https://github.com/cairo-book/cairo-book.github.io/"
1919
edit-url-template = "https://github.com/cairo-book/cairo-book.github.io/edit/main/{path}"
2020
playground.runnable = true
21+
google-analytics = "G-0ZJLBV4KE2"

theme/index.hbs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@
103103
html.classList.add("sidebar-" + sidebar);
104104
</script>
105105

106+
<!-- Google tag (gtag.js) -->
107+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-0ZJLBV4KE2"></script>
108+
<script>
109+
window.dataLayer = window.dataLayer || [];
110+
function gtag(){dataLayer.push(arguments);}
111+
gtag('js', new Date());
112+
113+
gtag('config', 'G-0ZJLBV4KE2');
114+
</script>
115+
106116
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
107117
<div class="sidebar-scrollbox">
108118
{{#toc}}{{/toc}}

0 commit comments

Comments
 (0)