Skip to content

Commit 8d2b697

Browse files
author
Calvin Allen
committed
Fix
1 parent c049717 commit 8d2b697

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby-2.7.2

_config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ title: "Coding with Calvin"
6969

7070
category_dir: 'category'
7171

72-
analytics:
73-
google_analytics_id: "G-KSJFBF9RTY"
72+
google_analytics_id: "G-KSJFBF9RTY"
7473

7574
disqus:
7675
shortname: "calvinallen" # Your disqus shortcode. leave this blank to disable comments globally
Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
11
{% if jekyll.environment == "production" %}
2-
{% assign gid = site.env.NETLIFY_GOOGLE_ANALYTICS_ID %}
3-
{% if gid %}
4-
<script async src="https://www.googletagmanager.com/gtag/js?id={{ gid }}"></script>
2+
{% if site.google_analytics_id %}
3+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_id }}"></script>
54
<script>
65
window.dataLayer = window.dataLayer || [];
76
function gtag() {
87
dataLayer.push(arguments);
98
}
109
gtag('js', new Date());
11-
gtag('config', '{{ $gid }}');
10+
gtag('config', '{{ site.google_analytics_id }}');
1211
</script>
13-
{% else %}
14-
{% if site.google_analytics_id %}
15-
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_id }}"></script>
16-
<script>
17-
window.dataLayer = window.dataLayer || [];
18-
function gtag() {
19-
dataLayer.push(arguments);
20-
}
21-
gtag('js', new Date());
22-
gtag('config', '{{ site.google_analytics_id }}');
23-
</script>
24-
{% endif %}
2512
{% endif %}
26-
{% endif %}
13+
{% endif %}

0 commit comments

Comments
 (0)