al_analytics 0.1.1 → 1.0.1
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +17 -22
- data/lib/al_analytics.rb +13 -0
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2672563a11d0ae87024e6121b82a4e4c0febe85191138825476d9d5a0d9da8f1
|
|
4
|
+
data.tar.gz: e07973e23df274cd170870b99a66b89a46c99a659150dd014e3197a6c4618403
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 42721456b650b5404e7f51fa4bcb3ce5de1f7898e61c40f954c4c422ecdc385438b6d3379258c33b0899ead902424d07ccb822072a6970cb7f0bbd3ae7aca42a
|
|
7
|
+
data.tar.gz: ca744bfcdc681eb2227dfdc2d54ed17a68ba6de55b00dbcb35e28453fd9854103bec86eea833209ad2557531d19cdbb17c2e4247e05f1e9a4d0d94aeb233bd7b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.1 - 2026-07-27
|
|
4
|
+
|
|
5
|
+
- 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.
|
|
6
|
+
|
|
3
7
|
## 0.1.1 - 2026-02-07
|
|
8
|
+
|
|
4
9
|
- Fixed a Liquid compatibility bug by renaming the internal `blank?` helper to avoid conflict with Liquid parser internals.
|
|
5
10
|
- Added unit tests for analytics rendering, legacy config fallbacks, and cookie-consent attribute injection.
|
|
6
11
|
|
|
7
12
|
## 0.1.0 - 2026-02-07
|
|
13
|
+
|
|
8
14
|
- Initial gem release.
|
|
9
15
|
- Added support for modern al-folio analytics config keys with legacy `analytics:` fallback.
|
|
10
16
|
- Added optional cookie-consent script attributes and provider enable flags.
|
data/README.md
CHANGED
|
@@ -1,38 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# al-analytics
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`al_analytics` provides analytics integrations for `al-folio` v1.x and compatible Jekyll sites.
|
|
4
4
|
|
|
5
|
-
## Supported
|
|
5
|
+
## Supported providers
|
|
6
6
|
|
|
7
7
|
- Google Analytics
|
|
8
8
|
- Cronitor Analytics
|
|
9
9
|
- Pirsch Analytics
|
|
10
10
|
- OpenPanel Analytics
|
|
11
|
+
- Simple Analytics
|
|
11
12
|
|
|
12
13
|
## Installation
|
|
13
14
|
|
|
14
|
-
Add this line to your Jekyll site's Gemfile:
|
|
15
|
-
|
|
16
15
|
```ruby
|
|
17
16
|
gem 'al_analytics'
|
|
18
17
|
```
|
|
19
18
|
|
|
20
|
-
And then execute:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
$ bundle install
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
1. Add the plugin to your site's `_config.yml`:
|
|
29
|
-
|
|
30
19
|
```yaml
|
|
31
20
|
plugins:
|
|
32
21
|
- al_analytics
|
|
33
22
|
```
|
|
34
23
|
|
|
35
|
-
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
Configure analytics in `_config.yml`:
|
|
36
27
|
|
|
37
28
|
```yaml
|
|
38
29
|
enable_cookie_consent: false
|
|
@@ -48,20 +39,24 @@ pirsch_analytics: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
|
|
48
39
|
|
|
49
40
|
enable_openpanel_analytics: false
|
|
50
41
|
openpanel_analytics: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
|
|
51
|
-
```
|
|
52
42
|
|
|
53
|
-
|
|
43
|
+
# Simple Analytics identifies your site by domain, so there is no key to set.
|
|
44
|
+
enable_simple_analytics: false
|
|
45
|
+
```
|
|
54
46
|
|
|
55
|
-
|
|
47
|
+
Render scripts in your layout:
|
|
56
48
|
|
|
57
49
|
```liquid
|
|
58
50
|
{% al_analytics_scripts %}
|
|
59
51
|
```
|
|
60
52
|
|
|
61
|
-
|
|
53
|
+
Legacy `analytics:` hash configuration is still supported.
|
|
54
|
+
|
|
55
|
+
## Ecosystem context
|
|
62
56
|
|
|
63
|
-
|
|
57
|
+
- Starter wiring happens in `al-folio` (`Gemfile` + `_config.yml`).
|
|
58
|
+
- Consent/runtime coordination can be combined with `al_cookie`.
|
|
64
59
|
|
|
65
60
|
## Contributing
|
|
66
61
|
|
|
67
|
-
|
|
62
|
+
Provider/runtime changes belong here. Starter-only docs/demo updates belong in `al-folio`.
|
data/lib/al_analytics.rb
CHANGED
|
@@ -68,6 +68,12 @@ module AlAnalytics
|
|
|
68
68
|
HTML
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
+
if flag_enabled?(site, "enable_simple_analytics")
|
|
72
|
+
output << <<~HTML
|
|
73
|
+
<script#{cookie_attrs} async src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
|
|
74
|
+
HTML
|
|
75
|
+
end
|
|
76
|
+
|
|
71
77
|
output.join("\n")
|
|
72
78
|
end
|
|
73
79
|
|
|
@@ -87,6 +93,13 @@ module AlAnalytics
|
|
|
87
93
|
legacy_config[legacy_key]
|
|
88
94
|
end
|
|
89
95
|
|
|
96
|
+
# Simple Analytics identifies a site by its domain rather than by an
|
|
97
|
+
# embedded key, so there is no identifier to fall back on: the provider is
|
|
98
|
+
# controlled by its enable flag alone and stays off unless it is set.
|
|
99
|
+
def flag_enabled?(site, flag_key)
|
|
100
|
+
!!site.config[flag_key]
|
|
101
|
+
end
|
|
102
|
+
|
|
90
103
|
def enabled?(site, flag_key, value)
|
|
91
104
|
return false if value_blank?(value)
|
|
92
105
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: al_analytics
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- al-org
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|
|
@@ -59,7 +59,7 @@ dependencies:
|
|
|
59
59
|
version: '2.0'
|
|
60
60
|
- - "<"
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: '
|
|
62
|
+
version: '5.0'
|
|
63
63
|
type: :development
|
|
64
64
|
prerelease: false
|
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -69,7 +69,7 @@ dependencies:
|
|
|
69
69
|
version: '2.0'
|
|
70
70
|
- - "<"
|
|
71
71
|
- !ruby/object:Gem::Version
|
|
72
|
-
version: '
|
|
72
|
+
version: '5.0'
|
|
73
73
|
- !ruby/object:Gem::Dependency
|
|
74
74
|
name: rake
|
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -103,7 +103,7 @@ metadata:
|
|
|
103
103
|
allowed_push_host: https://rubygems.org
|
|
104
104
|
homepage_uri: https://github.com/al-org-dev/al-analytics
|
|
105
105
|
source_code_uri: https://github.com/al-org-dev/al-analytics
|
|
106
|
-
post_install_message:
|
|
106
|
+
post_install_message:
|
|
107
107
|
rdoc_options: []
|
|
108
108
|
require_paths:
|
|
109
109
|
- lib
|
|
@@ -118,8 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
118
118
|
- !ruby/object:Gem::Version
|
|
119
119
|
version: '0'
|
|
120
120
|
requirements: []
|
|
121
|
-
rubygems_version: 3.
|
|
122
|
-
signing_key:
|
|
121
|
+
rubygems_version: 3.5.22
|
|
122
|
+
signing_key:
|
|
123
123
|
specification_version: 4
|
|
124
124
|
summary: Analytics integration tags for al-folio Jekyll sites
|
|
125
125
|
test_files: []
|