jekyll-attendease 0.6.43.2 → 0.6.43.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fd982ba5a7fab63d1dd6c4fedc02de729f5b22e
|
4
|
+
data.tar.gz: f40d85fcabf1092cfd65ef5e39812764c570002a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c484e974e21529b3cbc326b8af17fe10c236ee22746ae550a063f1eeeb44e22eb901d8e78c56f1096c1b4c6c88cbb032e1224cb4d8f826ed1bcd8fd6ee4477a
|
7
|
+
data.tar.gz: f5787c010552bef0e81779f2200db19e0a48f57a9060c49a9a2f09f5afcbeefdea17f9e567887d1b700bb9342bef8ab72a0fbf29259a1657011d9f16e90defc6
|
@@ -322,21 +322,22 @@ _EOT
|
|
322
322
|
site_settings = context.registers[:site].data['site_settings'].clone
|
323
323
|
analytics = site_settings['analytics']
|
324
324
|
|
325
|
-
|
326
|
-
|
327
|
-
|
325
|
+
has_analytics_id = !analytics.nil? && !analytics['googleAnalyticsTrackingId'].nil? && !analytics['googleAnalyticsTrackingId'].empty?
|
326
|
+
has_adwords_id = !analytics.nil? && !analytics['googleAnalyticsAdwordsId'].nil? && !analytics['googleAnalyticsAdwordsId'].empty?
|
327
|
+
return '' if analytics.nil? || (!has_analytics_id && !has_adwords_id)
|
328
|
+
|
329
|
+
gtag_id = has_analytics_id ? analytics['googleAnalyticsTrackingId'] : analytics['googleAnalyticsAdwordsId']
|
328
330
|
|
329
|
-
adwordsId = analytics['googleAnalyticsAdwordsId']
|
330
331
|
script = <<_EOT
|
331
332
|
<!-- Global Site Tag (gtag.js) - Google Analytics -->
|
332
|
-
<script async src="https://www.googletagmanager.com/gtag/js?id
|
333
|
+
<script async src="https://www.googletagmanager.com/gtag/js?id=#{gtag_id}"></script>
|
333
334
|
<script>
|
334
335
|
window.dataLayer = window.dataLayer || [];
|
335
336
|
function gtag(){dataLayer.push(arguments);}
|
336
337
|
gtag('js', new Date());
|
337
338
|
|
338
|
-
gtag('config', '#{analytics['googleAnalyticsTrackingId']}');
|
339
|
-
#{
|
339
|
+
#{ has_analytics_id ? " gtag('config', '#{analytics['googleAnalyticsTrackingId']}');" : ''}
|
340
|
+
#{ has_adwords_id ? " gtag('config', '#{analytics['googleAnalyticsAdwordsId']}');" : ''}
|
340
341
|
</script>
|
341
342
|
_EOT
|
342
343
|
script
|
@@ -134,7 +134,9 @@ RSpec.describe "Jekyll Attendease tags" do
|
|
134
134
|
subject { cms_render("{% attendease_analytics_ga_gtag %}") }
|
135
135
|
|
136
136
|
it { is_expected.to match(/Global Site Tag \(gtag.js\)/) }
|
137
|
-
it { is_expected.to match(/
|
137
|
+
it { is_expected.to match(/js\?id=google_analytics/) }
|
138
|
+
it { is_expected.to match(/gtag\('config'\, 'google_analytics'\)/) }
|
139
|
+
it { is_expected.to match(/gtag\('config'\, 'adwords'\)/) }
|
138
140
|
end
|
139
141
|
|
140
142
|
describe "{% attendease_analytics_linked_in %}" do
|
@@ -155,7 +157,7 @@ RSpec.describe "Jekyll Attendease tags" do
|
|
155
157
|
subject { cms_render("{% attendease_analytics_settings %}") }
|
156
158
|
|
157
159
|
it { is_expected.to match(/Global Analytics Settings/) }
|
158
|
-
it { is_expected.to match(/googleAnalyticsTrackingId: "
|
160
|
+
it { is_expected.to match(/googleAnalyticsTrackingId: "google_analytics"/) }
|
159
161
|
it { is_expected.to match(/window.AnalyticsSettings = /) }
|
160
162
|
end
|
161
163
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-attendease
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.43.
|
4
|
+
version: 0.6.43.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Wood
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2018-11-
|
15
|
+
date: 2018-11-30 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: httparty
|