An open API service indexing awesome lists of open source software.

https://github.com/bnomei/kirby3-posthog

Connect Kirby to Posthog
https://github.com/bnomei/kirby3-posthog

analytics kirby kirby-cms kirby-plugin kirby3 kirby4 kirby5 posthog self-hosted

Last synced: 4 months ago
JSON representation

Connect Kirby to Posthog

Awesome Lists containing this project

README

          

# Kirby Posthog

![Release](https://flat.badgen.net/packagist/v/bnomei/kirby3-posthog?color=ae81ff&icon=github&label)
[![Discord](https://flat.badgen.net/badge/discord/bnomei?color=7289da&icon=discord&label)](https://discordapp.com/users/bnomei)
[![Buymecoffee](https://flat.badgen.net/badge/icon/donate?icon=buymeacoffee&color=FF813F&label)](https://www.buymeacoffee.com/bnomei)

Kirby Plugin for interfacing with [Posthog](https://posthog.com/)

## Install

- unzip [master.zip](https://github.com/bnomei/kirby3-posthog/archive/master.zip) as folder `site/plugins/kirby3-posthog` or
- `git submodule add https://github.com/bnomei/kirby3-posthog.git site/plugins/kirby3-posthog` or
- `composer require bnomei/kirby3-posthog`

## Setup

You can set the apikey and host in the config.

**site/config/config.php**
```php
return [
// other config settings ...
'bnomei.posthog.apikey' => 'YOUR-KEY-HERE',
'bnomei.posthog.host' => 'YOUR-HOST-HERE',
];
```

You can also set a callback if you use the [dotenv Plugin](https://github.com/bnomei/kirby3-dotenv).

**site/config/config.php**
```php
return [
// other config settings ...
'bnomei.posthog.apikey' => function() { return env('POSTHOG_APIKEY'); },
'bnomei.posthog.host' => function() { return env('POSTHOG_HOST'); },
];
```

### Javascript

Output the tracking Javascript via the snippet included in the plugin.

```php