Add outbound links and file downloads tracking for plausible.io (#774)
### Prerequisites
Put an `x` into the box(es) that apply:
- [ ] This pull request fixes a bug.
- [x] This pull request adds a feature.
- [ ] This pull request introduces breaking change.
### Description
Configuration options to activate [outbound link click
tracking](https://plausible.io/docs/outbound-link-click-tracking) and
[file downloads
tracking](https://plausible.io/docs/file-downloads-tracking).
These are two standard options for Plausible that are convenient and
useful in many circumstances.
### Issues Resolved
List any existing issues this pull request resolves.
### Checklist
Put an `x` into the box(es) that apply:
#### General
- [x] Describe what changes are being made
- [x] Explain why and how the changes were necessary and implemented
respectively
- [ ] Reference issue with `#<ISSUE_NO>` if applicable
#### Resources
- [ ] If you have changed any SCSS code, run `make release` to
regenerate all CSS files
#### Contributors
- [x] Add yourself to `CONTRIBUTORS.md` if you aren't on it already
---------
Co-authored-by: Luiz F. A. de Prá <luizdepra@users.noreply.github.com>
| | |
| | | - [Martin Hellspong](https://github.com/marhel) |
| | | - [Robert Tucker](https://github.com/robertwtucker) |
| | | - [Michał Pawlik](https://michalp.net) |
| | | - [Kilian Kluge](https://github.com/ionicsolutions) |
| | | - [Jaroslaw Rozanski](https://jarekrozanski.eu) |
| | |
| | | # [params.plausibleAnalytics] |
| | | # domain = "example.com" |
| | | # serverURL = "analytics.example.com" # Default value is plausible.io, overwrite this if you are self-hosting or using a custom domain |
| | | # outboundLinksTracking = true |
| | | # fileDownloadsTracking = true |
| | | |
| | | # If you want to use goatcounter(https://goatcounter.com) for analytics, add this section |
| | | # [params.goatCounter] |
| | |
| | | <script async defer data-domain="{{ .Site.Params.plausibleAnalytics.domain }}" src="https://{{ .Site.Params.plausibleAnalytics.serverURL | default "plausible.io" }}/js/script.js"></script> |
| | | <script async defer data-domain="{{ .Site.Params.plausibleAnalytics.domain }}" src="https://{{ .Site.Params.plausibleAnalytics.serverURL | default "plausible.io" }}/js/script{{if .Site.Params.plausibleAnalytics.fileDownloadsTracking}}.file-downloads{{end}}{{if .Site.Params.plausibleAnalytics.outboundLinksTracking}}.outbound-links{{end}}.js"></script> |