This plugin helps generate Google Analytics code snippet easily with the help of Liquid Tag or Liquid Variable Filter
This plugin is available as a RubyGem
Add this line to your application's Gemfile:
gem 'liquid-google-analytics'
And then execute the bundle install
command to install the gem.
Alternatively, you can also manually install the gem using the following command:
$ gem install liquid-google-analytics
For Jekyll Users, after the plugin has been installed successfully, add the following lines to your _config.yml in order to tell Jekyll to use the plugin:
gems:
- liquid-google-analytics
You need to use google_analytics
as liquid tag and pass the Tracking Code as parameter shown below
{% google_analytics UA-12345 %}
Optionally now you can also maintain Google Analytics code in config and use filter for variable as below
ga_code: UA-12345
{{ site.ga_code | google_analytics }}
Fork this repository, create your branch, make changes and then issue a pull request.
If you find bugs or have new ideas that you do not want to implement yourself, file a bug report.
Copyright (c) 2016 Rohan Sakhale
License: MIT