Skip to content

Commit

Permalink
added google tag
Browse files Browse the repository at this point in the history
  • Loading branch information
SyedMSawaid committed Jan 13, 2025
1 parent 80c6093 commit 0a5b455
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/_components/analytics.liquid
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-EV19L88CZQ"></script>
<!-- Google Tag Manager -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-EV19L88CZQ');
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-55GD6TZ2');
</script>
<!-- End Google Tag Manager -->
10 changes: 10 additions & 0 deletions src/_components/no_scrirpt.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- Google Tag Manager (noscript) -->
<noscript
><iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-55GD6TZ2"
height="0"
width="0"
style="display:none;visibility:hidden"
></iframe
></noscript>
<!-- End Google Tag Manager (noscript) -->
2 changes: 2 additions & 0 deletions src/_layouts/default.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
{% render 'head', metadata: site.metadata, title: data.title %}
</head>
<body class="flex flex-col items-center justify-center bg-gray-50">
{% render 'no_script' %}

<div class="md:w-[600px] pt-10 px-1 sm:px-4">
{% render 'navbar', metadata: site.metadata, resource: resource %}

Expand Down

0 comments on commit 0a5b455

Please sign in to comment.