mirror of
https://github.com/hendrikschneider/jekyll-analytics
synced 2024-11-22 03:33:06 +00:00
No description
7431b6ef42
Bumps [json](https://github.com/flori/json) from 2.2.0 to 2.3.1. **This update includes a security fix.** - [Release notes](https://github.com/flori/json/releases) - [Changelog](https://github.com/flori/json/blob/master/CHANGES.md) - [Commits](https://github.com/flori/json/compare/v2.2.0...v2.3.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> |
||
---|---|---|
.github/workflows | ||
lib | ||
test | ||
.gitignore | ||
.travis.yml | ||
Gemfile | ||
Gemfile.lock | ||
jekyll-analytics.gemspec | ||
LICENSE.txt | ||
Rakefile | ||
README.md | ||
ruby.yml | ||
spec_helper.rb |
Jekyll::analytics
Webanalytics for Jekyll.
There are many tutorials online to add analytics to Jekyll by extending the template. Jekyll-analytics is here to take care of this. Just install the plugin, configure it and you are done :)
Jekyll-analytics: Webanalytics made easy.
Supported:
Installation
Add this to your Gemfile
:
gem 'jekyll-analytics'
Then execute
$ bundle
Or install it yourself
gem install jekyll-analytics
Configuration
Edit _config.yml
to use the plugin:
plugins:
- jekyll-analytics
Configure the plugin in _config.yml
by adding:
jekyll_analytics:
GoogleAnalytics: # Add, if you want to track with Google Analytics
id: UA-123-456 # Required - replace with your tracking id
anonymizeIp: false # Optional - Default: false - set to true for anonymized tracking
Matomo: # Add, if you want to track with Matomo (former Piwik Analytics)
url: matomo.example.com # Required - url to Matomo installation without trailing /
siteId: "1234" # Required - replace with your Matomo site id (Write id as string)
Piwik: # Add, if you want to track with Piwik
url: piwik.example.com # Required - url to Piwik installation without trailing /
siteId: "1234" # Required - replace with your Piwik site id (Write id as string)
MPulse: # Add if you want to track performance with mPulse
apikey: XXXXX-YYYYY-ZZZZZ-AAAAA-23456 # Required - replace with your mPulse API key
Usage
Tracking will be disabled in development mode. To enable production mode set enviroment variable JEKYLL_ENV=production. Github pages automatically sets JEKYLL_ENV to production. For testing use
$ JEKYLL_ENV=production jekyll serve
Contributing
- Fork it ( https://github.com/hendrikschneider/jekyll-analytics/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
How to add support for a new tracker:
- Create new tracker class in lib/analytics/YourTracker.rb
#initialize and render must be implemented!
class YourTracker
def initialize(config)
#validate config
end
def render
return "Tracking code to insert into html > head"
end
end
- Update README.md