# @dbp-toolkit/matomo

> You can install this component via npm:

Latest version **0.2.14** (published 2026-11-17) · LGPL-2.1-or-later license · 0 weekly downloads

## Install

```sh
npm install @dbp-toolkit/matomo
pnpm add @dbp-toolkit/matomo
yarn add @dbp-toolkit/matomo
bun add @dbp-toolkit/matomo
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.14 |
| Published | 2026-11-17 |
| First published | 2020-12-21 |
| Weekly downloads | 0 |
| License | LGPL-2.1-or-later |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 5 |
| Maintainers | lazka, pbek, dbp-deploy |

## Links

- npm: https://www.npmjs.com/package/@dbp-toolkit/matomo
- Repository: https://github.com/digital-blueprint/toolkit
- Homepage: https://github.com/digital-blueprint/toolkit/tree/main/packages/matomo
- Issues: https://github.com/digital-blueprint/toolkit/issues
- npm.io page: https://npm.io/package/@dbp-toolkit/matomo

## Dependencies (3)

- [lit](https://npm.io/package/lit.md) ^3.0.0
- [@dbp-toolkit/auth](https://npm.io/package/@dbp-toolkit/auth.md) ^0.3.10
- [@dbp-toolkit/common](https://npm.io/package/@dbp-toolkit/common.md) ^0.3.19

## Recent versions

- 0.2.14 (latest) — 2026-11-17
- 0.2.13 — 2026-04-01
- 0.2.12 — 2025-10-07
- 0.2.11 — 2025-01-21
- 0.2.10 — 2025-01-09
- 0.2.9 — 2025-01-09
- 0.2.8 — 2024-06-12
- 0.2.7 — 2023-03-03
- 0.2.6 — 2022-06-23
- 0.2.5 — 2022-04-05
- 0.2.4 — 2021-06-16
- 0.2.3 — 2021-03-30
- 0.2.2 — 2021-02-22
- 0.2.1 — 2021-02-17
- 0.2.0 — 2021-02-10
- … 4 more at https://npm.io/package/@dbp-toolkit/matomo/versions

## README

## Matomo Web Component

You can install this component via npm:

```bash
npm i @dbp-toolkit/matomo
```

### Usage

```html
<dbp-matomo></dbp-matomo>
<script type="module" src="node_modules/@dbp-toolkit/matomo/dist/dbp-matomo.js"></script>
```

Or directly via CDN:

```html
<dbp-matomo></dbp-matomo>
<script type="module" src="https://unpkg.com/@dbp-toolkit/matomo@0.2.4/dist/dbp-matomo.js"></script>
```

### Attributes

- `endpoint` (required): set to your _Matomo_ server
    - example `<dbp-matomo endpoint="https://my-matomo.tld"></dbp-matomo>`
- `site-id` (required): set to your site id
    - example `<dbp-matomo site-id="456789"></dbp-matomo>`
- `auth` object: you need to set that object property for the login-status
    - example auth property: `{'login-status': 'logged-in'}`
    - note: most often this should be an attribute that is not set directly, but subscribed at a provider
- `analytics-event` object: for sending Matomo events

#### Emitted attributes

The component receives a `analytics-event` attribute to send Matomo events.
It looks like this:

```json
{
    "category": "the category of the event",
    "action": "the action of the event",
    "name": "the name of the event",
    "value": "the value of the event"
}
```

### Tracking actions

```html
<dbp-provider analytics-event>
    <dbp-matomo subscribe="analytics-event"></dbp-matomo>
    <your-dbp-adapter-limt-element-component></your-dbp-adapter-limt-element-component>
</dbp-provider>
```

In your AdapterLitElement component:

```javascript
this.sendSetPropertyEvent('analytics-event', {category: 'my category', action: 'my action'});
```

### Local development

```bash
# get the source
git clone git@github.com:digital-blueprint/toolkit.git
cd toolkit/packages/matomo

# install dependencies (make sure you have npm version 4+ installed, so symlinks to the git submodules are created automatically)
npm install

# constantly build dist/bundle.js and run a local web-server on port 8002
npm run watch

# run tests
npm test

# build local packages in dist directory
npm run build
```

Jump to <http://localhost:8002> and you should get a demo page.

---
_Source: https://npm.io/package/@dbp-toolkit/matomo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
