-
Notifications
You must be signed in to change notification settings - Fork 961
Document plausible-analytics
new config
#1805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cderv
wants to merge
2
commits into
prerelease
Choose a base branch
from
plausible-analytics
base: prerelease
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+51
−2
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -211,7 +211,56 @@ image: false | |||||||||||||||||||||||||||
--- | ||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
## Google Analytics | ||||||||||||||||||||||||||||
## Analytics | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
### Plausible Analytics | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
[Plausible Analytics](https://plausible.io/) is a lightweight, open-source, and privacy-friendly alternative to Google Analytics. Plausible is designed with privacy as a core principle: it doesn't use cookies, is GDPR compliant by default, and all data is processed anonymously. | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
To add Plausible Analytics to your Quarto website: | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
1. Sign up at [plausible.io](https://plausible.io/) and add your website to your account. | ||||||||||||||||||||||||||||
2. In your Plausible dashboard, navigate to your site's settings. | ||||||||||||||||||||||||||||
3. Go to the "Site Installation" section and click "Review Installation" to get your unique tracking snippet. | ||||||||||||||||||||||||||||
4. Copy the complete script snippet provided by Plausible from your dashboard. | ||||||||||||||||||||||||||||
5. Add it to your `_quarto.yml` configuration file under the `plausible-analytics` key: | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
For example, it could look like this, where `pa-XXXXXX.js` would be your own custom script provided by Plausible: | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
``` yaml | ||||||||||||||||||||||||||||
website: | ||||||||||||||||||||||||||||
plausible-analytics: | | ||||||||||||||||||||||||||||
<script async src="https://plausible.io/js/pa-XXXXXX.js"></script> | ||||||||||||||||||||||||||||
<script> | ||||||||||||||||||||||||||||
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}}; | ||||||||||||||||||||||||||||
plausible.init() | ||||||||||||||||||||||||||||
</script> | ||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
The script will automatically be included in the `<head>` of every page on your website. **Important:** Make sure to copy and paste the complete snippet exactly as provided by Plausible - the example above shows the typical structure, but your actual snippet will have a unique tracking code instead of `XXXXXX`. | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
::: {.callout-tip} | ||||||||||||||||||||||||||||
The snippet from your Plausible dashboard may include multiple `<script>` tags and initialization code. Copy the entire snippet as-is - don't modify or simplify it. | ||||||||||||||||||||||||||||
::: | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
#### Optional Enhanced Measurements | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Plausible offers optional enhanced measurements that you can enable directly in your site settings dashboard (such as outbound link tracking, file downloads, etc.). When you enable these features in Plausible, your tracking snippet will be automatically updated in your dashboard. Simply copy the updated snippet and replace it in your `_quarto.yml` configuration. | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
For more information about available enhanced measurements and configuration options, see the [Plausible script documentation](https://plausible.io/docs/plausible-script). | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
#### Privacy Benefits | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Unlike traditional analytics solutions, Plausible Analytics: | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- **No cookies**: Plausible doesn't use cookies or generate any persistent identifiers, so no cookie consent banners are needed | ||||||||||||||||||||||||||||
- **GDPR compliant**: All visitor data is anonymized and processed in the EU | ||||||||||||||||||||||||||||
- **Lightweight**: The script is under 1 KB, significantly smaller than Google Analytics | ||||||||||||||||||||||||||||
- **No cross-site tracking**: Plausible doesn't track users across different websites | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Comment on lines
+254
to
+260
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||
Because Plausible is privacy-friendly by default, you typically don't need to implement [Cookie Consent] when using it (though you should verify this with your own privacy requirements). | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
### Google Analytics | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
You can add [Google Analytics](https://analytics.google.com/) to your website by adding a `google-analytics` key to your `_quarto.yml` file. In its simplest form, you can just pass your Google Analytics tracking Id (e.g. `UA-xxxxxxx`) or Google Tag measurement Id (e.g. `G-xxxxxxx`) like: | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
@@ -242,7 +291,7 @@ In addition to this basic configuration, you can exercise more fine grained cont | |||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
: {tbl-colwidths="[20,80]"} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
### Storage | ||||||||||||||||||||||||||||
#### Storage | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Google Analytics uses cookies to distinguish unique users and sessions. If you choose to use cookies to store this user data, you should consider whether you need to enable [Cookie Consent] in order to permit the viewer to control any tracking that you enable. | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see getting the right indentation will be a source of problems for users...another reason to offer a
path
entrypoint.