---
title: "Send usage data only after the user says · Agent Wranglers"
url: https://agentwranglers.se/playbook/desktop-apps/crashes-telemetry-and-accessibility/telemetry-opt-in
id: DSK-42
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 1104
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Send usage data only after the user says yes

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Crashes, telemetry and accessibility](https://agentwranglers.se/playbook/desktop-apps/crashes-telemetry-and-accessibility.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: DSK-42
- Level: Recommended
- Chapter: [Crashes, telemetry and accessibility](https://agentwranglers.se/playbook/desktop-apps/crashes-telemetry-and-accessibility.md)
- Rule: Usage data and crash reports with an install ID stay off until the user turns them on, in a first-run choice or in settings. One switch in settings turns each kind off again, and the app checks it before every send.
- Check: On a fresh install with no choice made, a network capture during 10 minutes of use shows no request to the telemetry host. After the user turns telemetry off, a test runs the main flows and the capture again shows no request.
- How: Installed software runs on the user's own computer, and many users and companies block apps that report home without asking. Send nothing in the background before the user has chosen. Ask with a plain sentence about what you collect and why, and make "No" as easy as "Yes". Keep the collected fields in one list, and send only those fields. Read the choice inside the sending module, so no feature can skip it, as [track only after consent](https://agentwranglers.se/playbook/analytics/privacy-and-consent/analytics-consent.md) does for analytics. That rule also covers the EU law on reading data from a user's device. Respect a company policy setting that turns telemetry off for every user, and the `DO_NOT_TRACK=1` environment variable in command-line tools.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
export function sendUsage(event) {
  if (settings.get('telemetry') !== 'on' || process.env.DO_NOT_TRACK === '1' || policy.telemetryDisabled) return;
  const allowed = Object.fromEntries(Object.entries(event).filter(([key]) => COLLECTED_FIELDS.has(key)));
  net.fetch('https://telemetry.example.com/v1/events', { method: 'POST', body: JSON.stringify(allowed) });
}
```

### Python example

```python
def send_usage(event: dict) -> None:
    if settings.get("telemetry") != "on" or os.environ.get("DO_NOT_TRACK") == "1" or policy.telemetry_disabled:
        return
    allowed = {key: value for key, value in event.items() if key in COLLECTED_FIELDS}
    httpx.post("https://telemetry.example.com/v1/events", json=allowed, timeout=5)
```

## Sources

- [ePrivacy Directive Article 5(3)](https://eur-lex.europa.eu/eli/dir/2002/58/oj)
- [GDPR Article 7 on conditions for consent](https://eur-lex.europa.eu/eli/reg/2016/679/oj)

## Related rules

- DSK-41 [Keep symbols for every build you ship](https://agentwranglers.se/playbook/desktop-apps/crashes-telemetry-and-accessibility/desktop-crash-symbols.md) in Desktop apps and extensions
- ANA-7 [Track only after consent](https://agentwranglers.se/playbook/analytics/privacy-and-consent/analytics-consent.md) in Product analytics and experiments
- DEV-15 [Send no telemetry from CI or when DO_NOT_TRACK is set](https://agentwranglers.se/playbook/developer-tools/configuration-and-telemetry/cli-telemetry-off.md) in Developer tools, SDKs and CLIs

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/desktop-apps/crashes-telemetry-and-accessibility/telemetry-opt-in">Agent Wranglers desktop apps and extensions playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Keep symbols for every build you ship](https://agentwranglers.se/playbook/desktop-apps/crashes-telemetry-and-accessibility/desktop-crash-symbols.md)
- Next: [Make every window work with a keyboard and a screen reader](https://agentwranglers.se/playbook/desktop-apps/crashes-telemetry-and-accessibility/desktop-accessibility.md)
- [Crashes, telemetry and accessibility](https://agentwranglers.se/playbook/desktop-apps/crashes-telemetry-and-accessibility.md)
