tagreeve 0.4.0-rc.3 → 0.5.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 +20 -16
- package/dist/cli.js +10578 -2
- package/package.json +19 -10
- package/dist/chunk-XDYUCYGC.js +0 -8470
- package/dist/pingwright.js +0 -8
package/README.md
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
</picture>
|
|
6
6
|
</h1>
|
|
7
7
|
|
|
8
|
-
> **Pingwright is now Tagreeve.**
|
|
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
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. Tag-firing reports (which tags fired) are planned.
|
|
11
11
|
|
|
12
|
-
> **Status: 0.
|
|
12
|
+
> **Status: 0.5 (`0.5.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. 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,11 +17,15 @@ 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.
|
|
20
|
+
> **In 0.5.0-rc.2** (install with `npm i -g tagreeve@next` until 0.5.0): 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. What is still open is in [CHANGELOG.md](CHANGELOG.md) under "Known in 0.5.0-rc.2".
|
|
21
|
+
>
|
|
22
|
+
> **In 0.5.0-rc.1** (install with `npm i -g tagreeve@next` until 0.5.0): `run` and `suite` take `--server-container` and `--server-container-config`, which run your own published server container in Docker, route the browser's requests for your `serverHosts` to it, and record every call it makes to a vendor, decoded and checked like browser hits; `tagreeve server-container build` builds the image; a `meta-capi` decoder; `suite --stores` runs each scenario against several stores; `platformHost` flags Shopify infrastructure requests; `unloadGap` also covers the end of a run; `--by-page` keys mask value-like path segments; and the old command alias is gone.
|
|
23
|
+
>
|
|
24
|
+
> **In 0.4.0-rc.3:** the `payment` step types into the exact card frame it checked, and the declaration hint names the failed step's provider. 0.4.0-rc.2 added test-mode declarations for payment hosts, the `earlyIdentifiers` check and better baselines.
|
|
21
25
|
>
|
|
22
26
|
> **In 0.4.0-rc.1** (install with `npm i -g tagreeve@next` until 0.4.0): 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".
|
|
23
27
|
>
|
|
24
|
-
> **Not built yet:** the
|
|
28
|
+
> **Not built yet:** the tag-firing reporter templates and `expectedTags`, `tagreeve init`, 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`.
|
|
25
29
|
|
|
26
30
|
## Why
|
|
27
31
|
|
|
@@ -41,7 +45,7 @@ Tagreeve is built so that a coding agent, a CI job or a person can answer these
|
|
|
41
45
|
|
|
42
46
|
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.
|
|
43
47
|
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.
|
|
44
|
-
3. **Decodes hits.** Vendor plugins turn raw requests into readable hits: GA4 events and consent state, Google Ads, Meta 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.
|
|
48
|
+
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.
|
|
45
49
|
4. **Reports tag firing (not built yet).** An optional GTM template reports which tags fired or failed for each event, in the web container and the server container. Agents get this without a Google sign-in. Given the container's tag list, Tagreeve also reports which expected tags did not fire.
|
|
46
50
|
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.
|
|
47
51
|
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.
|
|
@@ -78,7 +82,7 @@ npm i -g tagreeve@next
|
|
|
78
82
|
tagreeve install-browser
|
|
79
83
|
```
|
|
80
84
|
|
|
81
|
-
Node 22.18 or later. `npm i -g tagreeve@next` installs the newest 0.
|
|
85
|
+
Node 22.18 or later. `npm i -g tagreeve@next` installs the newest 0.5 release candidate. Other ways to install, from a git tag or a tarball, are in [docs/cli.md](docs/cli.md).
|
|
82
86
|
|
|
83
87
|
## Quick start
|
|
84
88
|
|
|
@@ -99,9 +103,9 @@ Node 22.18 or later. `npm i -g tagreeve@next` installs the newest 0.4 release ca
|
|
|
99
103
|
4. `tagreeve run scenario.yml --site https://staging.example.com`
|
|
100
104
|
5. Read the summary, and the full record in `runs/run_<id>.jsonl`.
|
|
101
105
|
|
|
102
|
-
`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`, `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.
|
|
106
|
+
`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.
|
|
103
107
|
|
|
104
|
-
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. 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, 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.
|
|
108
|
+
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 and telemetry hosts (`cdn.shopify.com`, `monorail-edge.shopifysvc.com`) 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.
|
|
105
109
|
|
|
106
110
|
## Override and diff quick start
|
|
107
111
|
|
|
@@ -140,7 +144,7 @@ tagreeve suite scenarios/ --site https://staging.example.com \
|
|
|
140
144
|
tagreeve report runs/suite_<id> --html suite-report.html
|
|
141
145
|
```
|
|
142
146
|
|
|
143
|
-
`suite` runs every `*.yml` file in the folder once per variant, and prints a table with the result of each run and the diff between the variants. The runs and a `suite.json` manifest go to `runs/suite_<id>/`. The exit code is 2 if a run did not finish, 1 if an expectation failed, else 0. A scenario with a `handoff` step is skipped unless you add `--with-handoff`. `report` writes one HTML file with a timeline per vendor and consent state, the expectations, the flags and the diff. It has names and counts only, no script and no network request. `tagreeve report runs/run_<id>.jsonl --html report.html` makes the report for one run. Details are in [docs/cli.md](docs/cli.md).
|
|
147
|
+
`suite` runs every `*.yml` file in the folder once per variant, and prints a table with the result of each run and the diff between the variants. The runs and a `suite.json` manifest go to `runs/suite_<id>/`. The exit code is 2 if a run did not finish, 1 if an expectation failed, else 0. A scenario with a `handoff` step is skipped unless you add `--with-handoff`. To cover several storefronts, give `--stores stores.json` instead of `--site`. Every scenario then runs once per store. `report` writes one HTML file with a timeline per vendor and consent state, the expectations, the flags and the diff. It has names and counts only, no script and no network request. `tagreeve report runs/run_<id>.jsonl --html report.html` makes the report for one run. Details are in [docs/cli.md](docs/cli.md).
|
|
144
148
|
|
|
145
149
|
## Rules and steps added in 0.3
|
|
146
150
|
|
|
@@ -182,10 +186,10 @@ tagreeve run scenario.yml --site https://staging.example.com --tracker-list trac
|
|
|
182
186
|
|
|
183
187
|
## Safe by default
|
|
184
188
|
|
|
185
|
-
- **Known collection endpoints are stubbed by default.** Scripts load normally, but requests to known collection endpoints are recorded and answered locally. Unknown destinations pass through, so test hits can still reach vendors that way. Requests to hosts outside the site's registrable domain are flagged when they are `fetch`, `xhr`, `ping` or `beacon` requests, or images or other requests that carry a query or a body. They are flagged as `unknownDestination
|
|
189
|
+
- **Known collection endpoints are stubbed by default.** Scripts load normally, but requests to known collection endpoints are recorded and answered locally. Unknown destinations pass through, so test hits can still reach vendors that way. Requests to hosts outside the site's registrable domain are flagged when they are `fetch`, `xhr`, `ping` or `beacon` requests, or images or other requests that carry a query or a body. They are flagged as `unknownDestination`, except requests to known Shopify platform hosts, which get the flag `platformHost` and never fail a run. Scripts, stylesheets, fonts and documents are not flagged. Requests a sandboxed `srcdoc` iframe sends while it loads can escape stubbing and recording (design §5.3). Tagreeve lets them through because blocking by host would stop vendor scripts from loading and make a broken setup look compliant. Use `--network live` to let everything through.
|
|
186
190
|
- **Fake identities.** Every run uses a generated test identity. Tagreeve flags any email, phone number or hashed identifier in a recording that does not belong to that identity.
|
|
187
191
|
- **No log-ins, and payments only as an opt-in test.** On a hosted site a log-in is always a handoff step for a person, who should use test accounts. A payment is a handoff step too, except for the opt-in `payment` step, which types a provider's documented test card after three checks: `--allow-test-payment <host>`, the host in your allowlist file, and the provider's test mode, which you declare for the host in that file or which the page shows inside the card form. Only loopback hosts, such as the fixture shop, may be automated through a fake payment form.
|
|
188
|
-
- **You own the data.** There is no Tagreeve-hosted service.
|
|
192
|
+
- **You own the data.** There is no Tagreeve-hosted service. Everything runs on your machine. The opt-in server container feature runs your own container in your Docker, and the container downloads its own configuration from Google as it always does.
|
|
189
193
|
|
|
190
194
|
## For agents
|
|
191
195
|
|
|
@@ -197,12 +201,12 @@ Tagreeve will not change GTM containers or sign in to Google. An agent that edit
|
|
|
197
201
|
|
|
198
202
|
| Package | Job | State |
|
|
199
203
|
| --- | --- | --- |
|
|
200
|
-
| `core` | IDs, clock, record types, record schema version, JSONL run store, fake identity | 0.
|
|
201
|
-
| `recorder` | Launch the browser, play steps, capture requests, responses, cookies and dataLayer events, GTM override, Done control, locators, `server` mode | 0.
|
|
202
|
-
| `decoders` | One plugin per vendor, with synthetic fixtures as tests | 0.
|
|
204
|
+
| `core` | IDs, clock, record types, record schema version, JSONL run store, fake identity | 0.5 |
|
|
205
|
+
| `recorder` | Launch the browser, play steps, capture requests, responses, cookies and dataLayer events, GTM override, Done control, locators, `server` mode, server container | 0.5 |
|
|
206
|
+
| `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) |
|
|
203
207
|
| `consent` | Banner handling through DuckDuckGo autoconsent, Consent Mode probe, epochs | 0.1 |
|
|
204
|
-
| `expect` | Scenario format, expectations, `deniedIdentifiers`, diff engine | 0.
|
|
205
|
-
| `cli` | `tagreeve run`, `diff`, `suite`, `report`, `baseline`, `install-browser` | 0.
|
|
208
|
+
| `expect` | Scenario format, expectations, `deniedIdentifiers`, diff engine | 0.5 |
|
|
209
|
+
| `cli` | `tagreeve run`, `diff`, `suite`, `report`, `baseline`, `server-container build`, `install-browser` | 0.5 |
|
|
206
210
|
| `gtm` | Tag-firing reporter templates | not built yet |
|
|
207
211
|
| `platforms/shopify` | Custom-pixel bridge, sandbox URL handling, checkout handoff | not built yet |
|
|
208
212
|
|