Skip to content

Image Trackers

Some third-party images set cookies when they load — tracking pixels, social badges, embed previews, or widget images. Because a browser requests an image as soon as it parses the src attribute, these cookies are set before your visitor makes a consent choice.

Consent Pro detects these images during a scan and reports them so you can label them and block them manually.

How detection works

When Consent Pro scans your website, it loads each page in a real browser and watches the network responses of every third-party image, including redirects. If an image response sets a cookie, the scanner:

  1. Captures the cookie from the response headers — including httpOnly cookies that are invisible to JavaScript
  2. Attributes the cookie to the exact image that set it
  3. Reports the image and its cookies in the Consent Manager

In the Manager, these trackers show a from Image badge. A scan that finds cookie-setting images also creates an action item so you can review them.

Why images need a manual step

For scripts, Consent Pro can prevent execution before consent. Images work differently: the browser requests an image the moment a live src attribute is present in the HTML — there is no execution step to intercept. Leaving the tracking URL in a normal src attribute means the request (and its cookies) always fires, and Consent Pro cannot stop it.

That's why you swap the attribute once by hand. From there, Consent Pro takes over: it loads the image automatically when the visitor accepts the required categories, and removes the src again if consent is revoked — the same pattern used for iframes.

Block an image

Store the URL in fs-consent-src and add fs-consent-categories:

  1. Open the embed or element that renders the image
  2. Remove the normal src attribute so the browser does not request the image before consent
  3. Use fs-consent-src for the image URL and fs-consent-categories for the category
  4. Publish your site — Consent Pro sets src automatically once the visitor accepts the category

Example:

html
<img fs-consent-src="https://example.com/tracking-pixel.svg" fs-consent-categories="marketing" alt="" />

TIP

The Consent Manager generates this snippet for you. Open the affected tracker in Consent Manager, and the editor shows install instructions with a copy-ready snippet for each attributed image.

If the image is already labeled as a tracker in the Consent Manager, Consent Pro can also resolve its categories from your saved configuration — fs-consent-categories is then optional, but recommended for clarity.

Category Reference

Set fs-consent-categories to the value that matches the type of cookies the image sets:

CategoryValue
Essentialessential
Analyticsanalytics
Marketingmarketing
Personalizationpersonalization

You can assign an image to multiple categories by separating values with a comma — it will only load once the visitor has accepted all of the specified categories.

Essential images don't need blocking

Essential cookies don't require consent, so an image whose cookies are essential — for example a badge that only sets a security or bot-management cookie — can keep its normal src attribute. Just label the tracker as Essential in the Consent Manager so it's disclosed correctly.

Need help?

Get free support in our forum