Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 011c6c8

Browse files
committed
Added Google Analytics
1 parent dd0b83a commit 011c6c8

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

‎_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ logo: "/img/logo-2x.png"
3636
logo_width: 196
3737
logo_height: 233
3838

39-
#google_analytics_id: UA-00000000-0
39+
google_analytics_id: UA-7630729-3
4040
# google_site_verification: google_site_verification_key
4141
# docsearch_name: Kronuz
4242
# docsearch_key: 00000000000000000000000000000000

‎_includes/analytics.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{% if site.google_analytics_id %}
2-
<!-- Google Analytics (https://www.google.com/analytics) -->
2+
<!-- Global site tag (gtag.js) - Google Analytics -->
3+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_id }}"></script>
34
<script>
4-
!function(j,e,k,y,l,L){j.GoogleAnalyticsObject=y,j[y]||(j[y]=function(){
5-
(j[y].q=j[y].q||[]).push(arguments)}),j[y].l=+new Date,l=e.createElement(k),
6-
L=e.getElementsByTagName(k)[0],l.src='https://www.google-analytics.com/analytics.js',
7-
L.parentNode.insertBefore(l,L)}(window,document,'script','ga');
8-
ga('create', '{{ site.google_analytics_id }}', '{{ site.url }}');
9-
ga('send', 'pageview');
5+
window.dataLayer = window.dataLayer || [];
6+
function gtag(){dataLayer.push(arguments);}
7+
gtag('js', new Date());
8+
gtag('config', '{{ site.google_analytics_id }}');
109
</script>
1110
{% endif %}

‎_includes/top.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<link rel="stylesheet" href="{{ '/css/screen.css' | relative_url }}?_={{ site.time | date: '%s%N' }}">
1414
<link rel="icon" type="image/x-icon" href="{{ '/favicon.ico' | relative_url}}?_={{ site.time | date: '%s%N' }}">
1515
{% seo %}
16+
{% include analytics.html %}
1617
<script type="text/javascript">
1718
var plat = 'windows'
1819
if (/MacOSX/.test(navigator.userAgent)) {

‎_layouts/default.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
{% include footer.html %}
99
{% include anchor_links.html %}
10-
{% include analytics.html %}
1110
{% include search/script.html %}
1211
{% include scripts.html %}
1312
</body>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /