Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 51 additions & 2 deletions docs/websites/website-tools.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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>
```
Comment on lines +230 to +238
Copy link
Collaborator

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.


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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Unlike traditional analytics solutions, Plausible Analytics:
- **Uses no cookies**: Plausible doesn't use cookies or generate any persistent identifiers, so no cookie consent banners are needed
- **Is GDPR compliant**: All visitor data is anonymized and processed in the EU
- **Is lightweight**: The script is under 1 KB, significantly smaller than Google Analytics
- **Has no cross-site tracking**: Plausible doesn't track users across different websites

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:

Expand Down Expand Up @@ -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.

Expand Down