Integration for Microsoft Application Insights tracking in your Kirby site.
- Create a directory
application-insights
in your site's/site/plugins
directory. - Copy all files into this directory.
If you use Git for your site you can also install in a single step by using a Git submodule. From the root of your site execute this:
git submodule add https://github.com/bowstreet/application-insights-kirby.git site/plugins/application-insights
Configure the corresponding values in your site config.
Tip: Make use of Kirby's simple multi-environment options feature to set up tracking only for your production site.
- applicationinsights.active: true / false (Default: true)
- applicationinsights.instrumentationkey: (Use your Application Insights Instrumentation Key)
c::set('applicationinsights.active', true);
c::set('applicationinsights.instrumentationkey', 'your-instrumentation-key');
You can either add the following to your site's <head>
element or as the last element right before the closing </body>
tag.
<?php echo application_insights(); ?>
Matthias Wenz, bowstreet https://bowstreet.de