Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Commit 2b25fc7

Browse files
committed
docs: add new google analytics GA4
1 parent 14cbf19 commit 2b25fc7

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

docs/_config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ url: "https://food-limit.github.io"
1111
#data-ad-client: ca-pub-ABCD
1212
# google_ad_client: ca-pub-7380281265540998
1313

14-
google_analytics: "UA-113243461-1"
1514
#addthis_id: ra-xxxxxxxxxxxx
1615
#disqus_account: xxxxxx
1716

docs/_includes/scripts.html

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,12 @@
2424
<!-- Theme JavaScript -->
2525
<script src="js/new-age.min.js"></script>
2626

27-
{% if site.google_analytics %}
28-
<script type="text/javascript">
29-
var _gaq = _gaq || [];
30-
_gaq.push(['_setAccount', '{{ site.google_analytics }}']);
31-
_gaq.push(['_trackPageview']);
32-
(function () {
33-
var ga = document.createElement('script');
34-
ga.type = 'text/javascript';
35-
ga.async = true;
36-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
37-
var s = document.getElementsByTagName('script')[0];
38-
s.parentNode.insertBefore(ga, s);
39-
})();
27+
<!-- Google tag (gtag.js) -->
28+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-BNZE96EFVM"></script>
29+
<script>
30+
window.dataLayer = window.dataLayer || [];
31+
function gtag(){dataLayer.push(arguments);}
32+
gtag('js', new Date());
33+
34+
gtag('config', 'G-BNZE96EFVM');
4035
</script>
41-
{% endif %}

0 commit comments

Comments
 (0)