Skip to content

Commit

Permalink
Merge pull request #44 from DavidS/plausible
Browse files Browse the repository at this point in the history
Add support for plausible.io
  • Loading branch information
hendrikschneider authored Oct 23, 2020
2 parents 6bb1bf6 + d7d1fb7 commit 40e0957
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Supported:
- [Matomo](https://matomo.org/)
- [Piwik](https://piwik.org/)
- [mPulse](https://www.soasta.com/performance-monitoring/)
- [Plausible](https://plausible.io)

## Installation

Expand Down Expand Up @@ -56,6 +57,10 @@ jekyll_analytics:

MPulse: # Add if you want to track performance with mPulse
apikey: XXXXX-YYYYY-ZZZZZ-AAAAA-23456 # Required - replace with your mPulse API key

Plausible:
domain: 'example.com' # The domain configured in plausible
source: 'https://plausible.example.com/js/plausible.js' # The source of the javascript
```
## Usage
Expand Down
10 changes: 10 additions & 0 deletions lib/analytics/plausible.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class Plausible
def initialize(config)
@domain = config['domain']
@source = config['source']
end

def render()
return "<script async defer data-domain=\"#{@domain}\" src=\"#{@source}\"></script>"
end
end

0 comments on commit 40e0957

Please sign in to comment.