Skip to content

Commit

Permalink
feat(analytics): added google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
SyedMSawaid committed Mar 31, 2024
1 parent d422315 commit c960859
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/_components/analytics.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4WM373MGM6"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-4WM373MGM6');
</script>
7 changes: 4 additions & 3 deletions src/_layouts/default.liquid
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<!doctype html>
<html lang="{{ site.locale }}">
<head>
{% render "head", metadata: site.metadata, title: data.title %}
{% render 'head', metadata: site.metadata, title: data.title %}
</head>
{% render 'analytics' %}
<body class="{{ data.layout }} {{ data.page_class }}">
{% render "navbar", metadata: site.metadata, resource: resource %}
{% render 'navbar', metadata: site.metadata, resource: resource %}

<main>
{{ content }}
</main>

{% render "footer", metadata: site.metadata %}
{% render 'footer', metadata: site.metadata %}
</body>
</html>

0 comments on commit c960859

Please sign in to comment.