tagreeve 0.8.0-rc.2 → 0.8.0-rc.3
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/CHANGELOG.md +12 -0
- package/README.md +3 -1
- package/dist/cli.js +19 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.0-rc.3
|
|
4
|
+
|
|
5
|
+
The third release candidate, after the rc.2 field test. Install it with `npm i -g tagreeve@next`. It has no new command. The record stays at schema version 5. To go back to the final release, run `npm i -g tagreeve`.
|
|
6
|
+
|
|
7
|
+
- Server container: a Meta Conversions API call links by event ID (of at least 8 characters) to a pixel hit sent up to 5 s after the call, when no consent epoch starts between the call and the hit. A hit across a consent change still does not link (#1641, #1639).
|
|
8
|
+
- On arm64 (Apple silicon), run `tagreeve server-container build` after `npm i -g tagreeve@next`. A run with `--server-container` exits 2 with "The image tagreeve-sgtm:<version> is not available" until the image for that version exists. On amd64 the command builds nothing.
|
|
9
|
+
|
|
10
|
+
### Known in 0.8.0-rc.3
|
|
11
|
+
|
|
12
|
+
- A server GA4 hit behind a container that answers before its call stays `probable` (#1640), so its identifier routes warn with `serverSendProbableLink`.
|
|
13
|
+
|
|
3
14
|
## 0.8.0-rc.2
|
|
4
15
|
|
|
5
16
|
The second release candidate, after the rc.1 field test. Install it with `npm i -g tagreeve@next`. It has no new command. The record stays at schema version 5. To go back to the final release, run `npm i -g tagreeve`.
|
|
@@ -44,6 +55,7 @@ The first release candidate of 0.8.0. Install it with `npm i -g tagreeve@next`.
|
|
|
44
55
|
- **The identity matcher is stricter.** It counts only a whole email or phone value, so a run can show a foreign value that 0.7.0 hid.
|
|
45
56
|
- **A moved `dataLayer` path is one line in `diff`.** `diff --json` gets `dataLayer.pathsMoved`.
|
|
46
57
|
- **Server hits are recorded for `*.google-analytics.com`.** Since #1622 the local container's own GA4 calls to `*.google-analytics.com` are recorded, so a rule such as `mustNot: { vendor: ga4, host: region1.google-analytics.com }` now matches server hits too. Add `sentBy: browser` to keep it to browser hits.
|
|
58
|
+
- **A new release needs a new server image.** On arm64 (Apple silicon), run `tagreeve server-container build` after `npm i -g tagreeve@next`. A run with `--server-container` exits 2 with "The image tagreeve-sgtm:<version> is not available" until the image for that version exists. On amd64 the command builds nothing.
|
|
47
59
|
- **The record stays at version 5.** A 0.7.0 record reads as before.
|
|
48
60
|
|
|
49
61
|
### Known in 0.8.0-rc.1
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
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. 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.8 (`0.8.0-rc.
|
|
12
|
+
> **Status: 0.8 (`0.8.0-rc.3`).** 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. 0.6.0-rc.3 fixes the reporter in real GTM, keeps the `dataLayer` hook working when a page replaces `push`, adds push kinds and a `dataLayerIncomplete` flag, and sends handoff text to stderr. 0.6.0 is rc.3 with the release prep and no code change; it was field-tested on a real store with a real GTM web container in a workspace preview (rc.2 and rc.3). 0.7.0 adds the `earlyIdentityPush`, `idHandover` and `serverContainerRejected` checks and `dataLayer:` rules. 0.8.0-rc.1 adds a consent audit: `suite --consent`, identifier canaries and the `identifierRoute` 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,6 +17,8 @@ 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.8.0-rc.3:** a Meta Conversions API call links by event ID (of at least 8 characters) to a pixel hit sent up to 5 s after the call, when no consent epoch starts in between. A hit across a consent change still does not link. After `npm i -g tagreeve@next`, run `tagreeve server-container build` on arm64, because the server container image is per version. The record stays at schema version 5. What is new is in [CHANGELOG.md](CHANGELOG.md) under 0.8.0-rc.3.
|
|
21
|
+
>
|
|
20
22
|
> **In 0.8.0-rc.2:** fixes after the rc.1 field test. A server call links to a browser hit by event ID only when the browser hit came first. A server GA4 hit behind a Stape loader links by client ID. `options.identifierRouteAllow` lists hosts, such as a consent tool's, that the `identifierRoute` check does not judge. The report shows one row per group of identifier routes, not one per flag. The record stays at schema version 5. `npm i -g tagreeve@next` installs it. What is new is in [CHANGELOG.md](CHANGELOG.md) under 0.8.0-rc.2.
|
|
21
23
|
|
|
22
24
|
> **In 0.8.0-rc.1:** a consent audit. `tagreeve suite --consent accept,reject,none,withdraw` runs each scenario once per consent state and prints what each vendor got in each state. `options.canaries: true` plants six fake click IDs on the start URL, and the run follows each canary (and the run's own identity) to the vendor requests it reaches, through the page URL, a first-party cookie and the local server container. The new `identifierRoute` check fails when a canary reaches a vendor that consent did not allow. The HTML report of a consent suite has a Consent audit section and the run report an Identifier routes section. Fixes: server-side rules read cannot evaluate when the container rejects most requests, a Stape loader request reaches the local container at its real path, the identity matcher needs a whole value, `idHandover` compares session IDs per client ID, `dataLayer` rules and consent command forms handle more real shapes, and `diff` shows a moved `dataLayer` path as one line. The record stays at schema version 5. `npm i -g tagreeve@next` installs it. What is new is in [CHANGELOG.md](CHANGELOG.md) under 0.8.0-rc.1.
|
package/dist/cli.js
CHANGED
|
@@ -8929,13 +8929,14 @@ ${request.postData ?? ""}`;
|
|
|
8929
8929
|
${decoded}`.toLowerCase();
|
|
8930
8930
|
return values.some((v) => text2.includes(v));
|
|
8931
8931
|
}
|
|
8932
|
+
var LATER_HIT_WINDOW_MS = 5e3;
|
|
8932
8933
|
function sharedKind(server, browser) {
|
|
8933
8934
|
if (server.eventId && server.eventId.length >= MIN_VALUE_LENGTH && server.eventId === browser.eventId) return "eventId";
|
|
8934
8935
|
for (const id of server.clientIds) if (browser.clientIds.has(id)) return "clientId";
|
|
8935
8936
|
if (server.identity && browser.identity) return "identity";
|
|
8936
8937
|
return void 0;
|
|
8937
8938
|
}
|
|
8938
|
-
function linkServerHits({ hits, requests, serverHosts, identity, inFlight }) {
|
|
8939
|
+
function linkServerHits({ hits, requests, serverHosts, identity, inFlight, epochStarts }) {
|
|
8939
8940
|
const byId2 = new Map(requests.map((r) => [r.id, r]));
|
|
8940
8941
|
const facts = hits.map((hit) => {
|
|
8941
8942
|
const request = byId2.get(hit.requestId);
|
|
@@ -8960,12 +8961,26 @@ function linkServerHits({ hits, requests, serverHosts, identity, inFlight }) {
|
|
|
8960
8961
|
});
|
|
8961
8962
|
const isServer = (f) => f.request?.captured === "serverContainer";
|
|
8962
8963
|
const browser = facts.filter((f) => !isServer(f));
|
|
8964
|
+
const sortedStarts = epochStarts ? [...epochStarts].sort((a, b) => a - b) : void 0;
|
|
8965
|
+
const nextEpochStart = (callAt) => {
|
|
8966
|
+
let lo = 0;
|
|
8967
|
+
let hi = sortedStarts.length;
|
|
8968
|
+
while (lo < hi) {
|
|
8969
|
+
const mid = lo + hi >> 1;
|
|
8970
|
+
if (sortedStarts[mid] > callAt) hi = mid;
|
|
8971
|
+
else lo = mid + 1;
|
|
8972
|
+
}
|
|
8973
|
+
return sortedStarts[lo] ?? Infinity;
|
|
8974
|
+
};
|
|
8963
8975
|
return facts.map((f) => {
|
|
8964
8976
|
if (!isServer(f)) return f.hit;
|
|
8965
8977
|
const callAt = f.request?.t;
|
|
8978
|
+
const epochEnd = callAt !== void 0 && sortedStarts ? nextEpochStart(callAt) : void 0;
|
|
8966
8979
|
const exact = f.eventId === void 0 ? [] : browser.filter((b) => {
|
|
8967
8980
|
if (b.eventId !== f.eventId || b.hit.event !== f.hit.event) return false;
|
|
8968
|
-
|
|
8981
|
+
if (callAt === void 0) return true;
|
|
8982
|
+
const sentAt = sentAtOf(b.hit.requestId, b.hit.t);
|
|
8983
|
+
return sentAt <= callAt || epochEnd !== void 0 && f.eventId.length >= MIN_VALUE_LENGTH && sentAt - callAt <= LATER_HIT_WINDOW_MS && sentAt < epochEnd;
|
|
8969
8984
|
});
|
|
8970
8985
|
if (exact.length === 1) return { ...f.hit, via: { hitId: exact[0].hit.id, by: "eventId", confidence: "exact" } };
|
|
8971
8986
|
const eventIdMiss = f.eventId === void 0 || f.hit.event === null ? "none" : exact.length === 0 ? "noMatch" : "several";
|
|
@@ -10004,7 +10019,8 @@ var Recorder = class _Recorder {
|
|
|
10004
10019
|
}
|
|
10005
10020
|
const requests = [...this.requests.values(), ...this.extraRequests];
|
|
10006
10021
|
let hits = requests.flatMap((r) => decodeRequest(r, void 0, this.trackers));
|
|
10007
|
-
|
|
10022
|
+
const consentEpochs = this.buildConsentEpochs();
|
|
10023
|
+
if (this.session) hits = linkServerHits({ hits, requests, serverHosts: this.options.serverHosts ?? [], identity: this.run.identity, inFlight: this.containerFlights, epochStarts: consentEpochs.map((e) => e.startT) });
|
|
10008
10024
|
const flags2 = buildFlags({
|
|
10009
10025
|
runId: this.runId,
|
|
10010
10026
|
networkMode: this.options.networkMode,
|
|
@@ -10035,7 +10051,6 @@ var Recorder = class _Recorder {
|
|
|
10035
10051
|
if (notHooked) flags2.push(notHooked);
|
|
10036
10052
|
flags2.push(...tallyFlags);
|
|
10037
10053
|
this.recordServerContainer(requests, hits, containerCounts, flags2);
|
|
10038
|
-
const consentEpochs = this.buildConsentEpochs();
|
|
10039
10054
|
let records = {
|
|
10040
10055
|
run: this.run,
|
|
10041
10056
|
steps: this.steps,
|