Coder Social home page Coder Social logo

htejera / publii-goatcounter-analytics-plugin Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 743 KB

This Publii plugin integrates GoatCounter analytics into your website, offering a privacy-friendly way to track site traffic and page views.

License: MIT License

JavaScript 100.00%
goatcounter publii

publii-goatcounter-analytics-plugin's Introduction

GoatCounter Integration for Publii

GoatCounter Integration for Publii

This plugin enables Publii site owners to easily integrate GoatCounter analytics and visitor counters into their websites, providing insights into site traffic and individual page views without compromising user privacy.

Features

  • Simple GoatCounter code integration.
  • Optional visitor counter display with customization options.
  • Support for HTML, SVG, and PNG counter types.
  • Customizable counter position using CSS selectors.
  • Option to remove GoatCounter branding from the visitor counter.

Setup

  1. GoatCounter Endpoint: You’ll need to copy this into the Endpoint field on the plugin configuration screen.

    GoatCounter Encpoint

  2. Plugin Configuration: Navigate to your Publii site settings and find the GoatCounter Integration plugin under the "Plugins" section.

    Plugin configuration 1 Plugin configuration 2

  3. Enter GoatCounter Code: Input your GoatCounter code in the provided field to link your Publii site with GoatCounter analytics.

  4. Preview Mode: Optionally, enable the output of the analytics code in preview mode for testing purposes. Remember to disable this before going live to avoid skewed analytics data.

Visitor Counter

To display a visitor counter on your site:

  1. Enable Visitor Counter: Check the "Show Visitor Counter" option in the plugin settings on Publii. You will need to enable “Allow adding visitor counts on your website” in your site settings panel on GoatCounter; this defaults to off to prevent unintentional leaking of data.

    GoatCounter allow adding visitor counts

  2. Selector Configuration: Specify the CSS selector for the parent element where the visitor counter will be appended. Default is footer.

  3. Counter Type: Choose the type of visitor counter (HTML, SVG, or PNG) according to your preference. An example of how this looks with the default settings:

    Visit counter

  4. Remove Branding: Optionally, enable "Remove GoatCounter Branding" to hide the "by GoatCounter" text from the visitor counter.

Customization

The visitor counter can be further customized through CSS. Depending on the counter type chosen (HTML or SVG), different elements can be styled:

  • HTML Counter: Style the surrounding div and internal elements as needed.
  • SVG Counter: Customize the #gcvc-border, #gcvc-for, #gcvc-views, and #gcvc-by elements using CSS.

Refer to the GoatCounter documentation for more detailed information on styling counters.

GDPR consent

This plugin does not handle GDPR consent, since GoattCounter (probably) does not require it. More information here: GDPR consent notices.

For more details on GoatCounter and its features, visit the official GoatCounter website.

License

This plugin is licensed under the MIT License.

Feel free to contribute to the development or suggest improvements by submitting a pull request or opening an issue on GitHub.

publii-goatcounter-analytics-plugin's People

Contributors

htejera avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.