Plugin to easily add webanalytics to your jekyll site. Currently Google Analytics, Piwik and mPulse ...
The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
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.
Add this to your
$ bundleOr install it yourself
gem install jekyll-analytics
_config.ymlto use the plugin:
plugins: - jekyll-analytics
Configure the plugin in
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
Tracking will be disabled in development mode. To enable production mode set enviroment variable JEKYLLENV=production. Github pages automatically sets JEKYLLENV to production. For testing use
$ JEKYLL_ENV=production jekyll serve
git checkout -b my-new-feature)
git commit -am 'Add some feature')
git push origin my-new-feature)
How to add support for a new tracker: 1. 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 ``` 2. Update README.md