al_analytics 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2672563a11d0ae87024e6121b82a4e4c0febe85191138825476d9d5a0d9da8f1
4
- data.tar.gz: e07973e23df274cd170870b99a66b89a46c99a659150dd014e3197a6c4618403
3
+ metadata.gz: eb0f197fe046cfdc04d3599054b64d7695d80231c98a7272f3e8eee79d3ed4ee
4
+ data.tar.gz: d1f64696a9fde0cb40afc73982954fc06d2300f1cc87edeeb811edd57c0fb517
5
5
  SHA512:
6
- metadata.gz: 42721456b650b5404e7f51fa4bcb3ce5de1f7898e61c40f954c4c422ecdc385438b6d3379258c33b0899ead902424d07ccb822072a6970cb7f0bbd3ae7aca42a
7
- data.tar.gz: ca744bfcdc681eb2227dfdc2d54ed17a68ba6de55b00dbcb35e28453fd9854103bec86eea833209ad2557531d19cdbb17c2e4247e05f1e9a4d0d94aeb233bd7b
6
+ metadata.gz: c8a55f8ec4527be4c010f20a3ca02a837cad2a4207528bd5624d6a50ead2162f9c0237c4f92c3cea7418273b4df3b87687e9e6ea7a75d2f895155ac79ecdf5fb
7
+ data.tar.gz: 2b7804a1748e47d54436f87a9cc1c7d4a57b07190706c495e57c18c129a56db2ac9bbdb86a41db9a91924fa3669a2c078a8f0b017ed768f38c8db07e4f95c378
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.2 - 2026-07-29
4
+
5
+ - Added support for Cloudflare Web Analytics via `cloudflare_analytics` (token) and `enable_cloudflare_analytics` (flag). The beacon is only emitted when a token is present, so an unset token renders nothing rather than a beacon tag with an empty `data-cf-beacon` token. As with the other token-bearing providers, the flag defaults to on when a token is set and `false` turns the provider off explicitly, the legacy `analytics.cloudflare` key is still honored, and `enable_cookie_consent` adds the `type="text/plain" data-category="analytics"` attributes so the script only runs after consent.
6
+
3
7
  ## 1.0.1 - 2026-07-27
4
8
 
5
9
  - Added support for Simple Analytics via `enable_simple_analytics`. The provider has no site key, so it is controlled by the flag alone and honors `enable_cookie_consent` like every other provider.
data/README.md CHANGED
@@ -8,6 +8,7 @@
8
8
  - Cronitor Analytics
9
9
  - Pirsch Analytics
10
10
  - OpenPanel Analytics
11
+ - Cloudflare Web Analytics
11
12
  - Simple Analytics
12
13
 
13
14
  ## Installation
@@ -40,6 +41,11 @@ pirsch_analytics: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
40
41
  enable_openpanel_analytics: false
41
42
  openpanel_analytics: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
42
43
 
44
+ # Cloudflare Web Analytics. The token is the value Cloudflare shows in the
45
+ # `data-cf-beacon` snippet; without it nothing is rendered.
46
+ enable_cloudflare_analytics: false
47
+ cloudflare_analytics: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
48
+
43
49
  # Simple Analytics identifies your site by domain, so there is no key to set.
44
50
  enable_simple_analytics: false
45
51
  ```
data/lib/al_analytics.rb CHANGED
@@ -68,6 +68,14 @@ module AlAnalytics
68
68
  HTML
69
69
  end
70
70
 
71
+ cloudflare_token = analytics_value(site, "cloudflare_analytics", "cloudflare")
72
+ if enabled?(site, "enable_cloudflare_analytics", cloudflare_token)
73
+ output << <<~HTML
74
+ <!-- Cloudflare Web Analytics -->
75
+ <script#{cookie_attrs} defer src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon='{"token": "#{cloudflare_token}"}'></script>
76
+ HTML
77
+ end
78
+
71
79
  if flag_enabled?(site, "enable_simple_analytics")
72
80
  output << <<~HTML
73
81
  <script#{cookie_attrs} async src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: al_analytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - al-org
@@ -85,7 +85,8 @@ dependencies:
85
85
  - !ruby/object:Gem::Version
86
86
  version: '13.0'
87
87
  description: Jekyll plugin extracted from al-folio that renders Google Analytics,
88
- Cronitor RUM, Pirsch, and OpenPanel scripts with optional cookie-consent attributes.
88
+ Cronitor RUM, Pirsch, OpenPanel, Cloudflare Web Analytics, and Simple Analytics
89
+ scripts with optional cookie-consent attributes.
89
90
  email:
90
91
  - dev@al-org.dev
91
92
  executables: []