Skip to content

Commit 9ea92b9

Browse files
committed
Google analytics trying
Signed-off-by: datta0 <[email protected]>
1 parent 9b602e8 commit 9ea92b9

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

_config.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,8 @@ google_site_verification: google_meta_tag_verification # change to your verifica
5353

5454

5555
google_analytics:
56-
id: 'G-15W008D4SZ' # fill in your Google Analytics ID
56+
id: G-15W008D4SZ # fill in your Google Analytics ID
5757
# Google Analytics pageviews report settings
58-
pv:
59-
proxy_endpoint: # fill in the Google Analytics superProxy endpoint of Google App Engine
60-
cache_path: # the local PV cache data, friendly to visitors from GFW region
6158

6259
# Prefer color scheme setting.
6360
#
@@ -70,7 +67,7 @@ google_analytics:
7067
# light - Use the light color scheme
7168
# dark - Use the dark color scheme
7269
#
73-
theme_mode: # [light|dark]
70+
theme_mode: 'dark' # [light|dark]
7471

7572
# The CDN endpoint for images.
7673
# Notice that once it is assigned, the CDN url

_includes/analytics/google.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<!-- Global site tag (gtag.js) - Google Analytics -->
2-
<script defer src="https://www.googletagmanager.com/gtag/js?id={{ site.analytics.google.id }}"></script>
1+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics.id }}"></script>
32
<script>
43
document.addEventListener('DOMContentLoaded', () => {
54
window.dataLayer = window.dataLayer || [];
@@ -8,6 +7,6 @@
87
}
98

109
gtag('js', new Date());
11-
gtag('config', '{{ site.analytics.google.id }}');
10+
gtag('config', '{{ site.google_analytics.id }}');
1211
});
13-
</script>
12+
</script>

_includes/head.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,17 @@
113113
{% endif %}
114114

115115
<!-- Web Analytics -->
116-
{% for analytics in site.analytics %}
116+
<!-- {% for analytics in site.analytics %}
117117
{% capture str %}{{ analytics }}{% endcapture %}
118118
{% assign platform = str | split: '{' | first %}
119119
{% if site.analytics[platform].id and site.analytics[platform].id != empty %}
120120
{% include analytics/{{ platform }}.html %}
121121
{% endif %}
122-
{% endfor %}
122+
{% endfor %} -->
123123
{% endif %}
124124

125+
<!-- Always enable google analytics czynot-->
126+
{% include analytics/google.html %}
127+
125128
{% include metadata-hook.html %}
126129
</head>

0 commit comments

Comments
 (0)