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
- Host: GitHub
- URL: https://github.com/bnomei/kirby3-posthog
- Owner: bnomei
- License: mit
- Created: 2022-03-21T14:17:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-09T16:06:28.000Z (11 months ago)
- Last Synced: 2025-07-03T13:55:49.021Z (5 months ago)
- Topics: analytics, kirby, kirby-cms, kirby-plugin, kirby3, kirby4, kirby5, posthog, self-hosted
- Language: PHP
- Homepage:
- Size: 121 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kirby Posthog

[](https://discordapp.com/users/bnomei)
[](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