Documenting consent capture API

This commit is contained in:
Jarek Rozanski 2025-01-27 22:34:01 +01:00
parent 124958f815
commit 648db48986
3 changed files with 55 additions and 4 deletions

View file

@ -5,8 +5,6 @@
[![Downloads][npm-downloads-src]][npm-downloads-href]
[![Wide Angle][wideangle-src]][wideangle-href]
![full_logo_color_light_transparent](https://user-images.githubusercontent.com/4896588/224442362-45dd92e7-e118-46ac-a423-83d479a9654b.png)
Enable **privacy-friendly** web analytics in your Vue.js 3.x application with our official plugin.
[Wide Angle Analytics](https://wideangle.co) is powerful, strictly-GDPR compliant Google Analytics alternative.
@ -59,7 +57,7 @@ app.use(WideAngle, {
siteId: "8D27G3B9ACA01F4241",
domain: "stats.example.com",
fingerprint: true,
supressDnt: true
suppressDnt: true
});
```
@ -123,6 +121,59 @@ const sendEvent = async () => {
</script>
```
# Consent Handling
By default, Wide Angle Analytics does nore require consent thanks to its privacy-first, anonymous tracking and principaled approached to compliance.
However, you have additional toggles should you wish to control consent, either in **Opt-In** or **Opt-Out** mode.
## Opt-Out by default
If the visitors browsers has `DoNotTrack` setting enabled in the browser, it will be understood as opt-out and not tracking events will be issued.
You website can't overwrite this behaviour by specifying `suppressDnt` setting.
```
app.use(WideAngle, {
siteId: "8D27G3B9ACA01F4241",
suppressDnt: true
});
```
## Opt-In or Opt-Out based on Cookie
Wide Angle can be configure to handle presence of a cookie, or a cookie with specific value, as an implicit consent. Lack of the cookie will be handled as implicit opt-out.
Example configuration with cookie marker, expecting cookie name `WAA_CONSENT` with value `true`:
```
app.use(WideAngle, {
siteId: "8D27G3B9ACA01F4241",
consentMarker: "WAA_CONSENT=true"
});
```
## Programmatic consent
The Wide Angle serving offers two additional methods, which allow for recording tracking consent:
- `recordConsent(subjectId: String): void`, and
- `revokeConsent()`
Calling above methods on `waa` service will overwrite other consent mechanism (ie. DoNotTrack, and cookie marker).
Example usage:
```
<script setup>
import { inject } from 'vue'
const waa = inject('waa');
waa.value.recordConsent('FHJ44111');
</script>
```
<!-- Badges -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

View file

@ -1,6 +1,6 @@
{
"name": "wideangle-vuejs",
"version": "1.0.1",
"version": "2.0.0",
"description": "Wide Angle Analytics web analytics Plugin for Vue.js 3.x",
"homepage": "https://wideangle.co",
"repository": "github:wideangleanalytics/wideangle-vuejs",