tagreeve 0.6.0-rc.1 → 0.6.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -11
- package/dist/cli.js +2950 -2048
- package/dist/templates/tagreeve-tag-reporter.tpl +176 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
> **Pingwright is now Tagreeve.** Versions up to 0.3.0 are on npm as `pingwright`, and `tagreeve` starts at 0.4.0-rc.1. The steps to move over are in [CHANGELOG.md](CHANGELOG.md).
|
|
9
9
|
|
|
10
|
-
Agent-first testing for tags and consent. Tagreeve plays a visitor in a real browser, records every tracking hit the site sends, and checks the result against what you expect.
|
|
10
|
+
Agent-first testing for tags and consent. Tagreeve plays a visitor in a real browser, records every tracking hit the site sends, and checks the result against what you expect. Web tag reports (which GTM web tags fired) come from a GTM template you install. Server tag reports are planned.
|
|
11
11
|
|
|
12
|
-
> **Status: 0.6 (`0.6.0-rc.
|
|
12
|
+
> **Status: 0.6 (`0.6.0-rc.2`).** Tagreeve plays a visitor in Chromium, records and decodes hits, answers the consent banner, checks YAML expectations and writes a JSONL record. 0.3 adds rules on payload fields and cookies, a `deniedIdentifiers` check, `tagreeve suite`, an HTML report, a Done control for handoff steps, role-based locators and a `select` step. 0.4 adds handoffs that end by themselves, an opt-in test payment step, baselines, a viewport option and fake identities by country. 0.5 adds `--server-container`, which runs your own server container in Docker and records what it sends to each vendor, a Conversions API decoder, several stores in one suite and platform hosts for Shopify. 0.6.0-rc.1 adds path defaults, `tagreeve init`, `tagreeve/config.yml`, `--label`, default baseline paths and `suite --baseline`, exact links between server container calls and browser hits by client ID, and the frame of each `dataLayer` push. 0.6.0-rc.2 adds web tag reports, `tagreeve template web`, `tag` rules, `expectedTags`, masked `dataLayer` push shapes in `diff` and baselines, and the `consentModeSetup` check. The rest of this README describes where Tagreeve is going, and marks what is not built yet. The design is in [docs/design.md](docs/design.md). Feedback is welcome in issues.
|
|
13
13
|
>
|
|
14
14
|
> **In 0.1:** `tagreeve run` with `stub` and `live` network modes; consent epochs, with withdrawals labelled apart from first rejects; seeded fake identities, hash checks and leak detection; decoders for GA4, Google Ads, Meta, Stape custom loader and a minimal server-container data client; banner handling through autoconsent; expectations; JSONL output.
|
|
15
15
|
>
|
|
@@ -17,9 +17,11 @@ Agent-first testing for tags and consent. Tagreeve plays a visitor in a real bro
|
|
|
17
17
|
>
|
|
18
18
|
> **In 0.3:** `body.has` and `body.only` rules on the field names of a hit; `cookie` rules; a `deniedIdentifiers` check that fails when an identifier goes out on a denied hit; `tagreeve suite` runs a folder of scenarios against several GTM builds; `tagreeve report` writes an HTML report of one run or a suite; a Done button in the handoff window; `click` and `wait` by role and name or from a list of selectors; a `select` step; the `server` network mode; record schema version 2. `deniedIdentifiers` fails by default, so a run that passed in 0.2 can exit 1. See [CHANGELOG.md](CHANGELOG.md).
|
|
19
19
|
>
|
|
20
|
-
> **In 0.6.0-rc.
|
|
20
|
+
> **In 0.6.0-rc.2:** the run record is schema version 5 and holds web tag reports from the `tagreeveTagReport` binding; `tagreeve template web` prints the reporter's GTM template; `tag` rules in `must` and `mustNot` and `expectedTags` in the GTM override file check which tags fired; the `--json` summary and the text summary have a `dataLayer` section; `diff` and `baseline` compare masked push shapes, with `diff --event-map`; `options.dataLayerNames` hooks a `dataLayer` with a custom name; the `consentModeSetup` check warns on a Consent Mode signal that was never set; `tagreeve init` writes `tagreeve/config.yml`; and a server container call that is not an exact link records why. What is still open is in [CHANGELOG.md](CHANGELOG.md) under "Known in 0.6.0-rc.2".
|
|
21
21
|
>
|
|
22
|
-
> **In 0.
|
|
22
|
+
> **In 0.6.0-rc.1:** `run` and `suite` write to `tagreeve/runs/<date>/` by default; `tagreeve init` makes the folders; `tagreeve/config.yml` holds `site`, `out` and scenario options and must start with `configSchemaVersion: 1`; `--label` names a run; `baseline save` and `suite --baseline` use `tagreeve/baselines/`; a scenario with `network: live` no longer loads; a `wait` timeout lists the controls that block submission; Shop Pay hosts are platform hosts; a server container call links exactly by client ID and event name when only one browser hit fits; and each `dataLayer` event records the frame that pushed it. What is still open is in [CHANGELOG.md](CHANGELOG.md) under "Known in 0.6.0-rc.1".
|
|
23
|
+
>
|
|
24
|
+
> **In 0.5.0:** a hit rule takes `sentBy: browser` or `sentBy: server`, so a rule on a Google host can ignore the server container's own forwarding; a missing `tagreeve-sgtm` image stops a suite before any scenario starts, and the message lists the local tags; the server container guide shows how to test an unpublished server workspace through its preview environment; and the text and `--json` summaries show query names only and mask value-like path segments, apart from the exceptions under Known in 0.5.0. Records keep the full detail. What is still open is in [CHANGELOG.md](CHANGELOG.md) under "Known in 0.5.0".
|
|
23
25
|
>
|
|
24
26
|
> **In 0.5.0-rc.2:** the `payment` step finds Shopify card fields by `name` or `autocomplete` and frame path; a server container call just after a handoff is stored without its body and query values; summaries show query names only; hit and cookie rules take `from: <step label>`; every command has its own `--help`; and `--by-page` masks more value-like path segments.
|
|
25
27
|
>
|
|
@@ -29,7 +31,7 @@ Agent-first testing for tags and consent. Tagreeve plays a visitor in a real bro
|
|
|
29
31
|
>
|
|
30
32
|
> **In 0.4.0-rc.1:** a `handoff` step can end at a URL or an element (`until`, `settle`, `timeout`); a `payment` step types a provider's test card on a store you allow, with three opt-in checks; `tagreeve baseline save` and `run --baseline` catch drift in the shape of a run; `--viewport <W>x<H>`; `identity.country` picks the format of the fake identity (US, SE, GB, DE); optional `fill` entries; a `possibleRedirectHop` flag; and the rename to Tagreeve. What is still open is in [CHANGELOG.md](CHANGELOG.md) under "Known in 0.4.0-rc.1".
|
|
31
33
|
>
|
|
32
|
-
> **Not built yet:** the tag
|
|
34
|
+
> **Not built yet:** the server tag reporter, a Shopify bridge, a full Microsoft UET decoder, a `mobile` viewport preset, Firefox and WebKit. There is no MCP server: Tagreeve is a CLI, and agents read `--json`.
|
|
33
35
|
|
|
34
36
|
## Why
|
|
35
37
|
|
|
@@ -42,7 +44,7 @@ Tracking setups break quietly. A trigger change lets a pixel fire before consent
|
|
|
42
44
|
Tagreeve is built so that a coding agent, a CI job or a person can answer these questions with one command and get structured results:
|
|
43
45
|
|
|
44
46
|
- What did the site send to each vendor, before and after the visitor's consent choice?
|
|
45
|
-
- Which tags fired for each event, and which expected tags did not?
|
|
47
|
+
- Which tags fired for each event, and which expected tags did not? See [Report which tags fired](docs/guide/tag-reports.md).
|
|
46
48
|
- Does an unpublished GTM workspace behave as intended, before you publish it? Run the same scenario with and without `--gtm-override` and compare the two records with `tagreeve diff`. (In 0.2.)
|
|
47
49
|
|
|
48
50
|
## What it does
|
|
@@ -50,7 +52,7 @@ Tagreeve is built so that a coding agent, a CI job or a person can answer these
|
|
|
50
52
|
1. **Plays a visitor.** A Playwright browser opens your site, answers the consent banner (accept, reject, or no answer), visits pages, fills forms with a fake identity and adds to cart. Steps that a tool must not do, such as paying or logging in, are handoff steps: a person acts in a visible window while recording continues.
|
|
51
53
|
2. **Records requests** from the page and from all iframes, including sandboxed iframes such as Shopify custom pixels. Capture from service workers works in Chromium only, and requests to the collector origin from dedicated workers are captured too. Each run reports which sources it covered.
|
|
52
54
|
3. **Decodes hits.** Vendor plugins turn raw requests into readable hits: GA4 events and consent state, Google Ads, Meta, Meta Conversions API and Stape server-container traffic. Pinterest is decoded in 0.2. Hosts on the tracker list, such as LinkedIn, Microsoft UET and Reddit, give minimal hits with the vendor name. A full Microsoft UET decoder is not built yet.
|
|
53
|
-
4. **Reports tag firing
|
|
55
|
+
4. **Reports tag firing.** An optional GTM template reports which tags fired or failed for each event in the web container. The server container is not covered yet. Agents get this without a Google sign-in, and `tagreeve template web --json` gives them the setup steps. Given the container's tag list, Tagreeve also reports which expected tags did not fire.
|
|
54
56
|
5. **Checks expectations.** Each scenario lists what must and must not happen, for example "no Meta request before consent" or "GA4 hits after a reject carry no user ID". Tagreeve reports pass or fail, with the evidence. A scenario that names a vendor Tagreeve does not know is rejected when it is parsed.
|
|
55
57
|
6. **Checks hashing.** Because Tagreeve knows the fake identity it typed, it can check that the hashed email and phone sent to Google and Meta are correct.
|
|
56
58
|
7. **Compares runs.** `tagreeve diff` shows what changed per vendor and per event between two runs, for example before and after a GTM change. `tagreeve suite` does this for a folder of scenarios.
|
|
@@ -91,7 +93,7 @@ Node 22.18 or later. `npm i -g tagreeve@next` installs the newest release candid
|
|
|
91
93
|
## Quick start
|
|
92
94
|
|
|
93
95
|
1. `npm i -g tagreeve@next`
|
|
94
|
-
2. `tagreeve install-browser`. In a project folder, `tagreeve init` makes `tagreeve/scenarios/` and `tagreeve/baselines
|
|
96
|
+
2. `tagreeve install-browser`. In a project folder, `tagreeve init` makes `tagreeve/scenarios/` and `tagreeve/baselines/`, writes a starter `tagreeve/config.yml` and keeps `tagreeve/runs/` out of git.
|
|
95
97
|
3. Write `scenario.yml`:
|
|
96
98
|
|
|
97
99
|
```yaml
|
|
@@ -107,6 +109,13 @@ Node 22.18 or later. `npm i -g tagreeve@next` installs the newest release candid
|
|
|
107
109
|
4. `tagreeve run scenario.yml --site https://staging.example.com`
|
|
108
110
|
5. Read the summary, and the full record in `tagreeve/runs/<date>/run_<id>.jsonl`.
|
|
109
111
|
|
|
112
|
+
To share the site between runs, put it in `tagreeve/config.yml`, then leave out `--site`:
|
|
113
|
+
|
|
114
|
+
```yaml
|
|
115
|
+
configSchemaVersion: 1
|
|
116
|
+
site: https://shop.example
|
|
117
|
+
```
|
|
118
|
+
|
|
110
119
|
`consent: none` needs a banner that autoconsent detects. If none is shown, the run stops with "banner not shown" and exit code 2. Vendor keys are `ga4`, `google-ads`, `meta`, `meta-capi`, `pinterest`, `sgtm`, and every vendor on the tracker list (`linkedin`, `microsoft-uet`, `reddit`) or in a `--tracker-list` file. A scenario that names any other vendor is rejected when it is parsed.
|
|
111
120
|
|
|
112
121
|
Stub mode is the default: known collection endpoints are recorded and answered locally. Unknown destinations still receive hits and are flagged as `unknownDestination`, which fails the run. The registrable domain of `--site` is first party: for `--site https://www.shop.co.uk`, `shop.co.uk` and every `*.shop.co.uk` host are not unknown. Data-carrying requests to those subdomains that no decoder matches, such as server-side GTM on `sgtm.shop.co.uk/collect`, are listed as `firstPartySubdomain` flags, grouped by host. They do not fail the run. Hosts without a registrable domain, such as IP addresses and `localhost`, are first party only as the exact `--site` host. If a site serves its own assets from another domain, list it under `options: { firstPartyHosts: ['i.example-cdn.com', '*.example-static.com'] }`. To accept specific unknown hosts without calling them first party, use `options: { allowUnknownDestination: ['tracker.example.net'] }`; every other unknown destination still fails. `allowUnknownDestination: true` allows all of them, and the summary still lists them. Requests to Shopify's CDN, telemetry and Shop Pay hosts (`cdn.shopify.com`, `cdn.shopifycloud.com`, `monorail-edge.shopifysvc.com`, `*.shopifysvc.com`, `pay.shopify.com`, `shop.app`) are flagged `platformHost` instead. They are listed but never fail the run. `options: { platformHosts: false }` flags them as `unknownDestination` again. A request sent while a sandboxed `srcdoc` iframe is loading can escape stubbing and recording (see [design §5.3](docs/design.md)). Use `--network live` to let everything through. Tagreeve decodes GA4, Google Ads, Meta, Meta Conversions API, Pinterest and Stape traffic, and stubs the hosts on the tracker list. Hits to other vendors, such as TikTok, are not stubbed unless you add them with `--tracker-list`: they pass through and can only show up as `unknownDestination` flags.
|
|
@@ -172,6 +181,7 @@ options:
|
|
|
172
181
|
- `cookie` checks which cookies were set, by name, before or after consent. In `stub` mode a stubbed endpoint sets no cookies, so use `--network server` with `options.serverHosts` to see the cookies of a server container.
|
|
173
182
|
- `deniedIdentifiers` is a built-in check. It fails when a hit carries `user_id`, `uid`, a hashed `user_data` field or another identifier while the matching consent signal is denied. It is `fail` by default. Set it to `warn` to keep the old exit code while you fix the cause.
|
|
174
183
|
- `earlyIdentifiers` is a built-in check. It warns when a hit sent before the first consent answer carries an identifier and its consent signal is unknown, for example a hashed email on a page with no Consent Mode default. It is `warn` by default, so the exit code stays the same. Set it to `fail` to fail the run.
|
|
184
|
+
- `consentModeSetup` is a built-in check. It warns when a Google hit shows a Consent Mode signal that was never set, for example a default without `ad_user_data` and `ad_personalization`. It reads the `gcd` value of each hit. It is `warn` by default. Set it to `fail` to fail the run.
|
|
175
185
|
- `click` and `wait` take `{ role, name }` or `{ any: [selectors] }`, so a theme change does not break every scenario. `select` chooses an option of a `<select>` by value, then by label, and reads it back.
|
|
176
186
|
|
|
177
187
|
## Tracker list
|
|
@@ -210,13 +220,13 @@ Tagreeve will not change GTM containers or sign in to Google. An agent that edit
|
|
|
210
220
|
| `decoders` | One plugin per vendor, with synthetic fixtures as tests | 0.5 (GA4, Google Ads, Meta, Meta Conversions API, Pinterest, Stape, server-container data client, tracker list; hit field names) |
|
|
211
221
|
| `consent` | Banner handling through DuckDuckGo autoconsent, Consent Mode probe, epochs | 0.1 |
|
|
212
222
|
| `expect` | Scenario format, expectations, `deniedIdentifiers`, diff engine | 0.5 |
|
|
213
|
-
| `cli` | `tagreeve run`, `diff`, `suite`, `report`, `baseline`, `server-container build`, `install-browser` | 0.5 |
|
|
214
|
-
| `gtm` | Tag-firing reporter
|
|
223
|
+
| `cli` | `tagreeve run`, `diff`, `suite`, `report`, `baseline`, `server-container build`, `template web`, `install-browser` | 0.5 |
|
|
224
|
+
| `gtm` | Tag-firing reporter template (web, printed by `tagreeve template web`) | web reporter in 0.6.0-rc.2; server reporter not built yet |
|
|
215
225
|
| `platforms/shopify` | Custom-pixel bridge, sandbox URL handling, checkout handoff | not built yet |
|
|
216
226
|
|
|
217
227
|
## Related tools
|
|
218
228
|
|
|
219
|
-
- **EDPS website-evidence-collector** records cookies and beacons, including before consent. Tagreeve adds vendor decoding, expectations and diffs. Tag reports are
|
|
229
|
+
- **EDPS website-evidence-collector** records cookies and beacons, including before consent. Tagreeve adds vendor decoding, expectations and diffs. Tag reports are in the [tag reports guide](docs/guide/tag-reports.md).
|
|
220
230
|
- **DuckDuckGo autoconsent** handles consent banners. Tagreeve uses it.
|
|
221
231
|
- **Snowplow Micro** does local, assertable event collection for Snowplow trackers.
|
|
222
232
|
- **ObservePoint**, **DataTrue** and **Trackingplan** are commercial services for tag auditing and monitoring.
|