Skip to content

Commit

Permalink
Add Google Analytics (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheldon-b authored Oct 12, 2024
1 parent 727ae75 commit cb387f0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
14 changes: 14 additions & 0 deletions _includes/core/google-analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-N6PDRF81KR"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());

gtag("config", "G-N6PDRF81KR");
</script>
4 changes: 2 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
layout: base
---

{% include core/header.html %} {% include components/hero-text.html
heading=page.title text=page.description %}
{% include core/header.html %} {% include core/google-analytics.html %} {%
include components/hero-text.html heading=page.title text=page.description %}
<div class="grid-container">{{ content }}</div>

{% include core/footer.html %}
4 changes: 2 additions & 2 deletions _layouts/hero-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: base
---

{% include core/header.html %} {% include components/hero-image.html
content=page.description %}
{% include core/header.html %} {% include core/google-analytics.html %} {%
include components/hero-image.html content=page.description %}
<div class="grid-container">{{ content }}</div>
{% include core/footer.html %}

0 comments on commit cb387f0

Please sign in to comment.