@analitikisler/ai-tag-debugger 0.20.1 → 0.21.0
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 +30 -0
- package/README.md +20 -9
- package/README.tr.md +20 -9
- package/package.json +1 -1
- package/src/agent.js +5 -1
- package/src/browser.js +168 -16
- package/src/campaign.js +7 -4
- package/src/checks.js +74 -20
- package/src/cli.js +2 -1
- package/src/cmp.js +166 -0
- package/src/consent.js +200 -26
- package/src/help.js +1 -0
- package/src/hit-params.js +70 -0
- package/src/html/consent.js +34 -9
- package/src/html/journeys.js +32 -70
- package/src/html/summary.js +1 -1
- package/src/i18n.js +152 -4
- package/src/mcp.js +280 -21
- package/src/metrics.js +13 -7
- package/src/parsers.js +62 -8
- package/src/report.js +9 -3
- package/src/verify.js +2 -0
package/src/report.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AD_PLATFORMS, consentTable } from "./consent.js";
|
|
1
|
+
import { AD_PLATFORMS, consentMatrixMarkdown, consentTable } from "./consent.js";
|
|
2
|
+
import { cmpFacts } from "./cmp.js";
|
|
2
3
|
import { ownerOf, verifyLinks } from "./verify.js";
|
|
3
4
|
import { createProvider } from "./providers.js";
|
|
4
5
|
import { canonicalEvent, groupFindings, summarize } from "./checks.js";
|
|
@@ -293,8 +294,10 @@ function mdCell(m, col, cell, raw, adPlatform) {
|
|
|
293
294
|
}
|
|
294
295
|
|
|
295
296
|
/** The consent section: the Consent Mode timing sentence, then the scenario table with a reason in every cell. */
|
|
296
|
-
function mdConsent(m, metrics, scenarios) {
|
|
297
|
+
function mdConsent(m, metrics, scenarios, runs = []) {
|
|
297
298
|
const lines = [`## ${m.ui.md.consent}`, ""];
|
|
299
|
+
const platform = cmpFacts(m, runs);
|
|
300
|
+
if (platform) lines.push(`${m.ui.cmp.title}: ${mdText(platform.vendor)}. ${platform.facts.map(mdText).join(" ")}`, "");
|
|
298
301
|
const cm = metrics.consent?.consentMode;
|
|
299
302
|
const tested = Boolean(cm?.runs?.length);
|
|
300
303
|
if (tested) {
|
|
@@ -307,6 +310,8 @@ function mdConsent(m, metrics, scenarios) {
|
|
|
307
310
|
lines.push(`| ${m.ui.scenarioTag} | ${cols.map((c) => m.ui.scenarioCols[c]).join(" | ")} |`, `|${" --- |".repeat(cols.length + 1)}`);
|
|
308
311
|
for (const r of rows) lines.push(`| ${mdText(platformLabel(r.platform))} \`${mdCode(r.event)}\` | ${r.cells.map((c) => mdCell(m, c.state, c, rawOf(c.state, r.platform, r.event), AD_PLATFORMS.has(r.platform))).join(" | ")} |`);
|
|
309
312
|
lines.push("", m.ui.md.consentLegend, "");
|
|
313
|
+
const matrix = consentMatrixMarkdown(m, scenarios);
|
|
314
|
+
if (matrix.length) lines.push(`### ${m.ui.matrix.title}`, "", ...matrix, "");
|
|
310
315
|
} else if (!tested) lines.push(m.ui.md.consentNotChecked, "");
|
|
311
316
|
return lines;
|
|
312
317
|
}
|
|
@@ -417,6 +422,7 @@ export function renderMarkdown({ title, site = null, generatedAt, findings, expl
|
|
|
417
422
|
const meta = [m.ui.md.meta(mdText(generatedAt), runs.length, m.ui.md.platformsSeen(platformsSeen.length, platformsSeen.map((p) => mdText(platformLabel(p))).join(", ")), VERSION), `[${m.ui.md.htmlReport}](report.html)`, ...(against ? [mdText(m.ui.checkedAgainst(against))] : [])];
|
|
418
423
|
const status = `**${m.verdict.status[metrics.verdict.status]}**${metrics.score?.score === null || metrics.score?.score === undefined ? "" : ` · ${m.ui.md.score(metrics.score.score)}`}`;
|
|
419
424
|
const lines = [`# ${mdText(m.ui.md.title(site ?? title, mdHeadline(m, runs, rows, metrics)))}`, "", meta.join(" · "), status, `**${m.ui.counts(counts)}**${changes && !changes.previous ? ` · ${m.ui.noPreviousRun}` : ""}`, ""];
|
|
425
|
+
if (runs.some((r) => r.live)) lines.push(`**${mdText(m.ui.liveRun)}**`, "");
|
|
420
426
|
if (accepted) lines.push(mdText(m.ui.acceptedLine(accepted)), "");
|
|
421
427
|
if (planChanges) lines.push(mdText(m.ui.planChangesLine(planChanges)), "", ...planChangeItems(planChanges).map((i) => `- ${mdText(i)}`), ...(planChangeItems(planChanges).length ? [""] : []));
|
|
422
428
|
const sum = summaryParts(explained?.summary);
|
|
@@ -436,7 +442,7 @@ export function renderMarkdown({ title, site = null, generatedAt, findings, expl
|
|
|
436
442
|
for (const f of problems.slice(0, MD_BLOCKS)) lines.push(...mdFinding(m, runs, f, ids));
|
|
437
443
|
const rest = problems.slice(MD_BLOCKS);
|
|
438
444
|
if (rest.length) lines.push(`### ${m.ui.md.also}`, ...rest.map((f) => `- **${m.severity[f.severity]}** ${mdDetail(f.detail).replace(/\.$/, "")} · ${mdWhere(m, runs, f.where, { full: false })}`), "");
|
|
439
|
-
lines.push(...mdConsent(m, metrics, consentScenarios));
|
|
445
|
+
lines.push(...mdConsent(m, metrics, consentScenarios, runs));
|
|
440
446
|
lines.push(...mdPassed(m, runs, findings, metrics, planCheck));
|
|
441
447
|
lines.push(...mdJourneys(m, runs, rows));
|
|
442
448
|
lines.push(...mdNotChecked(m, runs, rows, plan, consentScenarios));
|
package/src/verify.js
CHANGED
|
@@ -15,6 +15,8 @@ const OWNER_BY_CHECK = {
|
|
|
15
15
|
unplanned_events: "marketing",
|
|
16
16
|
planned_out_of_scope: "marketing",
|
|
17
17
|
ga4_automatic_event: "marketing",
|
|
18
|
+
page_blocked: "developer",
|
|
19
|
+
page_crashed: "developer",
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
/** Who most likely fixes this finding: the site's developer, whoever runs Tag Manager, or marketing (the plan itself). Tag and consent setup is the default. */
|