Your landing-page monitor says the offer changed. You open the screenshots, already wondering which campaign needs updating. A consent banner is covering the price.
The alert may be comparing different cleanup policies. hideFixedElements defaults to false because captures reset to the top, which already avoids repeated headers on most pages.
Enabling it hides fixed headers, full-screen overlays, and chat widgets. Sticky content cards deliberately survive. Hiding a consent banner does not establish an accepted consent state.
Example input for a monitored offer page makes the cleanup choices explicit:
const run_input = {
urls: ["https://example.com/offer"],
format: "png",
fullPage: true,
hideFixedElements: true,
cookieBannerAction: "hide",
selectorsToHide: "",
} as const;
That configuration belongs beside the screenshot in your comparison history. Otherwise, a cleanup edit can become an offer-change alert.
Separate configuration evidence from visual evidence
Start with what you can actually distinguish from outside the browser.
| Symptom | Distinguishing evidence | Easy misdiagnosis | Fix and its cost |
|---|---|---|---|
| The image changed after a cleanup edit | Saved cleanup settings differ from the baseline | Marketing changed the page | Hold the alert and establish a reviewed baseline. Historical comparisons cross a policy boundary. |
| A sticky offer card remains | Fixed cleanup was enabled; image and page inspection identify the surviving card | Cleanup failed | Keep commercially meaningful cards. Target unwanted elements explicitly, accepting selector maintenance. |
| A custom consent overlay remains | Inspect screenshotUrl; the submitted action alone cannot confirm removal |
The offer disappeared | Add a narrow selectorsToHide rule. Review it when the site changes. |
| The banner disappeared, but consent-dependent content is uncertain | Neither status nor warnings confirms accepted consent |
Acceptance succeeded because the banner vanished | Treat acceptance as unverified. Investigating consent-dependent behavior requires separate evidence. |
| There is no usable capture | Non-success status, missing file link, or an unfinished-success run state |
A blank page is the new offer | Route to capture review before comparing images. This delays the marketing alert. |
The visual cases need inspection. There's no overlay-removal result field to query.
A successful stored file answers a narrower question: did capture succeed? It doesn't certify that the offer is unobstructed.
Save the submitted policy beside the run
The Actor reports capture evidence, but your application must retain the cleanup settings it submitted.
Keep those settings immutable. Reading today's configuration when processing yesterday's screenshot quietly rewrites yesterday's evidence.
The following Example uses an in-memory map for the saved run metadata and an illustrative baseline with fixed cleanup disabled. In your service, persist these records in your job and baseline tables.
import { ApifyClient } from "apify-client";
import { z } from "zod";
type Policy = {
hideFixedElements: boolean;
cookieBannerAction: "hide" | "accept" | "off";
selectorsToHide: string;
selector: string;
fullPage: boolean;
};
const submittedPolicy: Policy = {
hideFixedElements: run_input.hideFixedElements,
cookieBannerAction: run_input.cookieBannerAction,
selectorsToHide: run_input.selectorsToHide,
selector: "",
fullPage: run_input.fullPage,
};
const baselinePolicy: Policy = {
...submittedPolicy,
hideFixedElements: false,
};
const client = new ApifyClient({
token: process.env.APIFY_TOKEN,
});
const run = await client
.actor("nimbryxo-studio/full-page-website-screenshot-and-pdf-capture")
.call(run_input);
const savedByRunId = new Map([
[run.id, { submittedPolicy, baselinePolicy }],
]);
const { items } = await client
.dataset(run.defaultDatasetId)
.listItems();
const Capture = z.object({
startUrl: z.string(),
status: z.string(),
screenshotUrl: z.string().url().optional(),
warnings: z.array(z.string()).optional().default([]),
});
const captures = items.map((item) => Capture.parse(item));
const saved = savedByRunId.get(run.id)!;
The blank selector in the application policy represents an omitted capture selector. These policy objects are application metadata, not invented dataset fields.
This job monitors a single submitted page. For batches, select each page's baseline using startUrl; don't join records by their array position.
Detect drift without claiming the banner is gone
Compare named policy fields directly. Preserve selector strings exactly: an unnecessary review is easier to explain than silently treating different CSS selectors as equivalent.
This detector separates confirmed policy changes from cases that still require visual evidence.
const policyKeys = [
"hideFixedElements",
"cookieBannerAction",
"selectorsToHide",
"selector",
"fullPage",
] as const;
function policyDiff(before: Policy, after: Policy) {
return policyKeys
.filter((key) => before[key] !== after[key])
.map((key) => ({
field: key,
before: before[key],
after: after[key],
}));
}
const reviews = captures.map((capture) => {
const changes = policyDiff(
saved.baselinePolicy,
saved.submittedPolicy,
);
const usable =
run.status === "SUCCEEDED" &&
capture.status === "success" &&
Boolean(capture.screenshotUrl);
return {
startUrl: capture.startUrl,
screenshotUrl: capture.screenshotUrl,
status: capture.status,
warnings: capture.warnings,
changes,
route: !usable
? "capture-review"
: changes.length > 0
? "baseline-review"
: "compare",
blockedStatus: capture.status.startsWith("error: blocked"),
reviewChecks: [
saved.submittedPolicy.hideFixedElements
? "Inspect surviving cards; sticky content is preserved."
: "Inspect fixed overlays; fixed cleanup was disabled.",
saved.submittedPolicy.cookieBannerAction === "off"
? "Consent cleanup was disabled."
: "Inspect consent overlays; handling is best effort.",
"Accepted consent cannot be inferred from this record.",
],
};
});
In n8n, branch on route before sending anything to the marketing-change channel.
compare admits the file to your existing image comparator. The review checks accompany any alert it produces; they don't require someone to inspect every routine capture.
baseline-review means the comparison contract changed. It doesn't mean the page stayed unchanged. Both changes can happen together.
Keep warnings available to the reviewer, but don't treat an empty array as clearance. Missing image warnings can't certify successful consent handling.
Why does the sticky offer card survive?
A purchase control can be part of the offer evidence. Removing it automatically could erase the price, qualification text, or action your sales team needs to review.
That's why fixed cleanup preserves sticky content blocks. Turning the switch on more enthusiastically won't change that boundary.
When a card survives, inspect the image first, then inspect the page element if its positioning is unclear. The dataset doesn't identify the element or report its CSS positioning.
If the card carries commercial meaning, leave it. If it's unrelated clutter, hide its specific container. A rule that removes every persistent-looking element can produce a beautifully clean screenshot of very little.
Target the obstruction, then preview the change
Consent hiding is best effort. It's more reliable than click-accept, but a custom banner may need a site-specific selector.
Use the narrowest selector that removes the obstruction without swallowing the offer container.
The Example selector below is a placeholder for an inspected banner. This function prepares a targeted rerun payload and a reviewable policy diff; it doesn't submit another run.
function proposeRerun(targetUrl: string, bannerSelector: string) {
const selectorsToHide = [
run_input.selectorsToHide.trim(),
bannerSelector.trim(),
]
.filter(Boolean)
.join("\n");
const rerun_input = {
...run_input,
urls: [targetUrl],
selectorsToHide,
};
const proposedPolicy: Policy = {
...submittedPolicy,
selectorsToHide,
};
const changes = policyDiff(submittedPolicy, proposedPolicy);
return {
rerun_input,
changes,
requiresNewBaseline: changes.length > 0,
};
}
const proposal = proposeRerun(
run_input.urls[0],
"#consent-dialog",
);
Extra hide selectors accept commas or newlines. Assign ownership to these rules: a redesign can make a selector ineffective, or make it match something newly valuable.
Capturing only the offer with selector is another option. It overrides fullPage, so you also lose surrounding evidence, such as eligibility text elsewhere on the page.
That's a scope decision, not merely a cleaner image.
A cleanup change needs a reviewed baseline
The worked example uses Complete Page Capture - Screenshot & PDF. The reusable pattern is to version the transformation alongside its artifact.
Keep the original baseline and its settings. After reviewing a capture under the new policy, promote that capture as the new baseline instead of overwriting the old policy metadata.
finished capture
-> usable file?
-> same cleanup policy?
yes -> image comparison -> review any change
no -> inspect capture -> approve new baseline
The catch is that equal cleanup policies don't guarantee equal rendered conditions. Best-effort consent handling can behave differently across captures.
Switching cookieBannerAction from hide to accept doesn't remove that uncertainty. A visual disappearance can't prove that a consent action succeeded or that consent-dependent content loaded.
Keep that uncertainty attached to the alert. Your sales team needs to know whether the offer changed, not merely whether the browser produced different pixels.
Before releasing the offer-change alert
- Confirm the run and item indicate a usable capture.
- Compare the saved cleanup policy with the baseline's policy.
- Inspect a surviving card before deciding it's unwanted.
- Review custom hide selectors against the offer and nearby terms.
- Preserve the old baseline when approving a policy change.
- Escalate unresolved consent-state questions separately.
A cleanup edit belongs in capture history before it belongs in campaign history.
Drafted with AI assistance and reviewed for accuracy.
Top comments (0)