https://github.com/cbos/hugo-faro-analytics
Hugo analytics module with Grafana Faro
https://github.com/cbos/hugo-faro-analytics
Last synced: 25 days ago
JSON representation
Hugo analytics module with Grafana Faro
- Host: GitHub
- URL: https://github.com/cbos/hugo-faro-analytics
- Owner: cbos
- License: mit
- Created: 2023-11-17T16:19:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-10T13:48:26.000Z (over 1 year ago)
- Last Synced: 2025-01-10T14:49:05.913Z (over 1 year ago)
- Language: HTML
- Size: 14.6 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Hugo analytics module with Grafana Faro
By default you can use Google Analytics with Grafana. But there are alternatives.
This module integrates Grafana Faro observability library with Hugo.
This module is inspired by https://github.com/hugomods/plausible-analytics
##
```shell
git submodule add https://github.com/cbos/hugo-faro-analytics.git themes/faro-analytics
```
## Enable module
```toml
[module]
[[module.imports]]
path = 'faro-analytics'
```
## Add to a page header
```
{{ partial "faro-analytics/assets/js" . }}
```
## Site Configuration TOML
| Parameter | type | required | description |
|-------------|--------|----------|----------------------------------------------------------------------------------------------|
| endpoint | string | yes | Url of the Faro collector like https://faro-collector-prod-eu-west-2.grafana.net/collect/xxx |
| name | string | yes | Name of the application |
| version | string | no | Version to report, can be used to make distinction between releases |
Environment like `production` or `development` is automatically added, as [hugo.Environment](https://gohugo.io/functions/hugo/environment/) variable is used.
```toml
[params]
[params.faro_analytics]
endpoint = "https://faro-collector-..."
name = "name"
version = "1.0.0"
```
## Page Configuration TOML
If you want to exclude a page from analytics, you can configure that per page.
| Parameter | type | required | description |
|-------------|---------|----------|-----------------------------------------------------------------------|
| enabled | boolean | no | By default analysis for a page is abled. Make it `false` to disable it |
```yaml
faro_analytics:
analyze: true
```