Giter VIP home page Giter VIP logo

kirby3-fathom-analytics's Introduction

Kirby Fathom Analytics

GitHub release (latest by date) Kirby CMS Version License

A Kirby 3 plugin for integrating the privacy focused Fathom Analytics service to your site.

Main Feautres

This plugin does two things:

  • It provides a panel view to display the Fathom Analytics dashboard directily in the panel
  • It provides a snippet to embed the Fathom Analytics tracking code

Requirements

  • Kirby CMS v3.4.0+

Installation

Download

Download and copy this repository to the plugins folder of your Kirby 3 installation. You should end up with a folder structure like this:

/site/plugins/fathom-analytics

Git submodule

If you prefer to use Git submodules, you can install the plugin like this:

git submodule add https://github.com/PaulMorel/kirby3-fathom-analytics.git site/plugins/fathom-analytics

Composer

If you are using Composer, you can install the plugin like this:

composer require paulmorel/fathom-analytics

Usage

Setup

After installing the plugin, there a couple of important steps to do in your Fathom Analytics settings.

  1. If not already done, add your site in Fathom Analytics
  2. Go to your site settings and get the SiteID.
  3. Still in the site settings, setup Site Sharing, either Public or Private.

Afterwards, in your site config, add your SiteID and the share password (if needed).

Example:

return [
    /* ... */
    'paulmorel.fathom-analytics' => [
        'siteId' => 'ABCDEFGH',
        'sharePassword' => 'hunter2'
    ]
    /* ... */
];

Embedding the tracking code

The tracking code is provided as a snippet, so it can be simply embedded in the <head> tag with the snippet() helper function.

If no siteId is provided, the snippet does nothing.

<head>
    <!-- ... -->
    <php snippet('fathom-analytics-embed'); ?>
    <!-- ... -->
</head>

Viewing your stats

The plugin provides a panel view that loads your site's analytics dashboard in an iframe. Simply open the menu in the panel's top bar and click on Analytics.

Options

siteId (Required)

This is the SiteID provided by Fathom Analytics at the top of your site's setting page.

sharePassword

This is the share password for your site's dashboard. This is only required if you set Site Sharing to Private.

customDomain

If you use the custom domain feature with Fathom Analytics, you can set it with this option.

Example:

'customDomain' => 'https://armadillo.example.com'

disableForRole

Allows you to disable the tracking code for logged in users with the specified roles. Expects an Array. Defaults to ['admin'].

Examples:

'disableForRole' => [
    'admin'
],
'disableForRole' => [
    'admin',
    'editor',
    'translator'
],

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

MIT

Support

This plugin is completely free to use, but if you'd like to support me or this project, consider signing-up to Fathom Analytics with my affiliate link.

kirby3-fathom-analytics's People

Contributors

paulmorel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kirby3-fathom-analytics's Issues

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.