Skip to content

Commit

Permalink
Moving to GA4
Browse files Browse the repository at this point in the history
  • Loading branch information
jayair committed Jun 11, 2023
1 parent ecb1673 commit 571847d
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions _includes/google-analytics.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');

</script>
<!-- Global site tag (gtag.js) - Google Ads: 1060291111 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-1060291111"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SCRGH28XB4"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'AW-1060291111');
</script>
{% if page.url == "/thanks.html" %}
<!-- Event snippet for Website lead conversion page -->
<script>
if (window.location.search.indexOf("source=ebook-download") != -1) {
// Log the even if coming from the ebook dl page
gtag('event', 'conversion', {'send_to': 'AW-1060291111/NEJsCIHvy-UCEKeEy_kD'});
}
</script>
{% endif %}
gtag('config', 'G-SCRGH28XB4');
</script>

0 comments on commit 571847d

Please sign in to comment.