Skip to content

Commit

Permalink
Upgrading to GA4
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCsabaToth committed Jun 4, 2023
1 parent 275f9bd commit 97fcb9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ app_source_repo: https://github.com/TreeWalks/tree-walk-guide
app_issues: https://github.com/TreeWalks/tree-walk-guide/issues/
play_store_url: https://play.google.com/store/apps/details?id=dev.csaba.armap.treewalk

# Google Analytics account ID (UA-XXXXXXXX-X)
google-analytics-ua: UA-86563829-10
# Google Analytics GA4
google-analytics-ga4: G-L6LLMSMWGT
gmaps_yo: "AIzaSyDUpDuBL2jGSyyYq4f1RtuxtL4X9JsK5jQ"
main_map:
lat: 36.812263
Expand Down
17 changes: 7 additions & 10 deletions _includes/google-analytics.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<!-- Google Analytics Script -->
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google-analytics-ga4 }}"></script>
<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');
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

ga('create', '{{ site.google-analytics-ua }}', 'auto', {});
ga('send', 'pageview', {
'anonymizeIp': true
});
gtag('config', '{{ site.google-analytics-ga4 }}');
</script>
<!-- END Google Analytics Script -->
<!-- END Google Analytics Script -->

0 comments on commit 97fcb9c

Please sign in to comment.