WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit d7d1fb7

Browse files
committed
Add support for plausible.io
1 parent 6bb1bf6 commit d7d1fb7

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Supported:
1414
- [Matomo](https://matomo.org/)
1515
- [Piwik](https://piwik.org/)
1616
- [mPulse](https://www.soasta.com/performance-monitoring/)
17+
- [Plausible](https://plausible.io)
1718

1819
## Installation
1920

@@ -56,6 +57,10 @@ jekyll_analytics:
5657

5758
MPulse: # Add if you want to track performance with mPulse
5859
apikey: XXXXX-YYYYY-ZZZZZ-AAAAA-23456 # Required - replace with your mPulse API key
60+
61+
Plausible:
62+
domain: 'example.com' # The domain configured in plausible
63+
source: 'https://plausible.example.com/js/plausible.js' # The source of the javascript
5964
```
6065
6166
## Usage

lib/analytics/plausible.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Plausible
2+
def initialize(config)
3+
@domain = config['domain']
4+
@source = config['source']
5+
end
6+
7+
def render()
8+
return "<script async defer data-domain=\"#{@domain}\" src=\"#{@source}\"></script>"
9+
end
10+
end

0 commit comments

Comments
 (0)