Download the PHP package bnomei/kirby3-posthog without Composer
On this page you can find all versions of the php package bnomei/kirby3-posthog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package kirby3-posthog
Kirby Posthog
Kirby Plugin for interfacing with Posthog
Install
- unzip master.zip as folder
site/plugins/kirby3-posthog
or git submodule add https://github.com/bnomei/kirby3-posthog.git site/plugins/kirby3-posthog
orcomposer require bnomei/kirby3-posthog
Setup
You can set the apikey and host in the config.
site/config/config.php
You can also set a callback if you use the dotenv Plugin.
site/config/config.php
Javascript
Output the tracking Javascript via the snippet included in the plugin.
Usage
PHP track pageview
site/template/default.php
PHP helper function
Use the posthog()
-helper to access Posthog. You can use all methods from the Posthog PHP library.
In addition to the posthog()
-helper this plugin adds the following features to the original library.
- Disabled on localhost by default
- Cache for Feature Flag list - it would otherwise send a http request to your posthog instance every time you access the list. It still will send one for every feature flag check.
[!WARNING] Using the static class from the official Posthog docs is not supported.
Settings
bnomei.posthog. | Default | Description |
---|---|---|
apikey | string or callback |
|
personalapikey | string or callback |
|
host | string or callback |
|
enabled | true or false or 'force' |
but disabled on localhost setups by default |
featureflags | 1 |
duration (in minutes) to cache the feature flags in minutes |
[!TIP] Read more about
apikey
andpersonalapikey
here: https://posthog.com/docs/api
Dependencies
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
It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.
All versions of kirby3-posthog with dependencies
getkirby/composer-installer Version ^1.2
posthog/posthog-php Version ^3.0