Sub topic 3
Strictly necessary and other exemptions
What this chapter assumes
You should already know how cookies and similar technologies work, and you should know that Article 5(3) of the ePrivacy Directive and Regulation 6 of PECR require consent before information is stored on, or read from, a visitor's device. This chapter covers the exceptions to that rule. It also explains why marketing technologies almost never qualify for them.
The two exemptions
The consent rule has two exemptions. Both are written in the same way in the ePrivacy Directive and in PECR. Consent is not needed if the storage or access is:
- For the sole purpose of carrying out the transmission of a communication over an electronic communications network. This is the communication exemption.
- Strictly necessary to provide an information society service explicitly requested by the subscriber or user. This is the strictly necessary exemption. An information society service is, in practice, a website or app service.
The communication exemption is narrow and rarely matters for website work. It covers technical steps such as routing a request to the right server. The strictly necessary exemption is the one you will apply most often.
Three parts of the second exemption carry most of the weight:
- Strictly necessary. The service cannot work without the storage or access. "Useful", "common" or "good for the business" does not meet this test.
- Service. The exemption applies to the service the user asked for, not to your wider commercial aims.
- Explicitly requested. The user must have taken a step that asks for the service, such as adding an item to a basket or logging in.
Applying the test
Ask these questions in order for each cookie, pixel, script or storage item:
- Does it store or read information on the device? If not, the consent rule does not apply to it. The GDPR may still apply if personal data is processed.
- Did the user explicitly request a service that depends on it?
- Would that service fail, or be unsafe, without it?
- Is the cookie limited to that purpose? A cookie used for the necessary function and also for marketing fails the test.
Assess each purpose on its own. The name of the tool or the vendor does not decide the result. The same cookie technology can be exempt for one purpose and need consent for another.
Typical exempt uses
| Use | Why it can be exempt | Limits |
|---|---|---|
| Shopping basket contents | The user asked to buy; the basket needs to remember items | Only while the session or purchase lasts |
| Login session cookie | The user asked to access their account | Should not be reused for tracking |
| Security cookie | Protects the user's requested service from fraud or attack | Must serve the requested service |
| Load balancing | Needed to deliver the requested page | Must not carry a profile of the user |
| Consent preference cookie | Records the user's choice so you can respect it | Store only the choice, not extra data |
| User interface customisation | Stores a choice the user made, such as language | Short-lived, set by the user's own action |
Regulators accept the consent preference cookie as exempt because without it you could not honour a refusal. It must hold only the choices and be kept for no longer than needed.
Typical non-exempt uses
- Advertising and retargeting cookies and pixels.
- Cross-site tracking identifiers.
- Social media plugins that set cookies for non-logged-in visitors.
- Affiliate tracking that profiles visitors.
- Cookies that measure ad campaign performance.
- Analytics in most cases (see below).
Where the EU and UK differ on analytics
Marketing teams often hope that analytics counts as strictly necessary. It generally does not. Analytics helps the site owner, not the visitor's requested service.
The position has moved in the UK. The Data (Use and Access) Act 2025 amends PECR to add new exceptions, which include some low-risk analytics (statistical purposes to improve the service) and certain website functionality. These exceptions come with conditions. The user must be given clear information and a simple, free way to object. Check the commencement status and the ICO's current guidance before you rely on them, because they depend on the date and the details of your use. The EU has no equivalent general exception in the ePrivacy Directive. Some EU regulators, such as the French CNIL, accept limited audience measurement without consent if strict conditions are met. These include a narrow purpose, no cross-site tracking and no data sharing with third parties. Other national regulators are stricter, so check the guidance of the country that regulates you.
Marketing uses are outside all of these exceptions. Do not treat analytics relief as permission to run advertising pixels.
Why marketing rarely qualifies
A marketing technology serves the organisation's commercial goals. The visitor did not explicitly request ad targeting, and the page functions without it. That fails both the "strictly necessary" and the "explicitly requested" parts of the test.
Two arguments come up often. Neither works:
- "It pays for the free service." Funding is not a function the user requested. The cookie is not strictly necessary to deliver the content.
- "We have a legitimate interest." Legitimate interests is a GDPR lawful basis for processing personal data. It does not remove the separate consent requirement for device access. The two rules apply side by side, and the stricter one controls the device access question.
Exemption and GDPR are separate questions
Being exempt from the cookie consent rule only settles the device access question. If the data counts as personal data, you still need a lawful basis, transparency, security and respect for data subject rights under the GDPR or UK GDPR. A common mistake is to say "this is a strictly necessary cookie, so we do not need to mention it". You should still list it in your privacy and cookie information, with its purpose and lifetime.
The reverse also holds. Having consent for a cookie under PECR does not by itself give you a lawful basis for everything done with the resulting personal data.
Mixed-purpose cookies and tag design
A single cookie often serves two purposes. A session cookie might keep a user logged in and also feed a marketing audience. If one purpose needs consent, the cookie needs consent for that purpose. Exempting it as a whole would be wrong.
You have two sound options:
- Split the purposes into separate cookies, so the necessary one loads always and the marketing one loads only after consent.
- Remove the marketing purpose.
The code below shows the split. The session cookie is always set because the user logged in. The marketing identifier waits for consent.
const consent = { marketing: false };
function startSession(sessionId) {
// Exempt: user explicitly logged in, cookie is needed for that service.
document.cookie =
'session_id=' + encodeURIComponent(sessionId) +
'; Secure; SameSite=Lax; Path=/';
}
function setMarketingId(id) {
if (!consent.marketing) {
return; // No consent, so do not store or read anything.
}
document.cookie =
'mkt_id=' + encodeURIComponent(id) +
'; Secure; SameSite=Lax; Path=/; Max-Age=' + 60 * 60 * 24 * 90;
}
function onConsentChange(choices) {
consent.marketing = choices.marketing === true;
}Note that the session cookie is set with Secure and SameSite, which supports the security reasoning. For a real login cookie you would normally also set HttpOnly from the server, which JavaScript cannot do.
Common mistakes
- Treating a whole vendor as necessary. A tag manager container might be exempt in itself, but the tags it fires are judged one by one.
- Calling a cookie "essential" in the banner for convenience. Regulators check the actual purpose, not the label.
- Long lifetimes on exempt cookies. A "strictly necessary" cookie that lasts two years is hard to defend. Keep the lifetime tied to the need.
- Using a necessary cookie as a stable identifier. If a session or security cookie also feeds user profiles, it has a second purpose.
- Forgetting non-cookie storage. Local storage, session storage, device fingerprinting and tracking pixels fall under the same rule. The same exemptions apply to them, and they are no easier to justify.
- Assuming an exemption covers reading as well as writing. Both storing and accessing need to be covered.
Decision flow
Worked example
A retailer's site sets these items. Applying the test gives:
| Item | Purpose | Result |
|---|---|---|
| `basket_id` | Keeps items in the basket during a visit | Exempt |
| `csrf_token` | Prevents forged form submissions on checkout | Exempt |
| `cookie_choices` | Stores the visitor's banner choices | Exempt |
| `_ad_pixel` | Retargeting ads on other sites | Consent needed |
| `ab_test_group` | Tests two homepage designs to improve sales | Consent needed in most cases |
| `session_id` that also feeds an ad audience | Login plus marketing | Split it |
The A/B testing row is arguable. Testing a design improves the business, but the visitor did not ask for it and the service works without it. Many regulators require consent, while the new UK analytics-style exceptions might cover some low-risk testing if their conditions are met.
Exercise
A site sets a cookie when the visitor logs in. The same cookie is read by the advertising team to build retargeting audiences. Can the site rely on the strictly necessary exemption for the cookie? What would you change?
Show answer
No. The cookie is strictly necessary for the login service, but it also serves a marketing purpose, and that purpose is not exempt. The exemption covers only the necessary purpose. Split the purposes: keep the session cookie for login only and set a separate marketing identifier after the visitor consents. Alternatively, stop the advertising team from using the session cookie.
Exercise
Your colleague says: "We rely on legitimate interests under the GDPR for our ad pixel, so we do not need cookie consent." Explain what is wrong with this.
Show answer
Legitimate interests is a lawful basis under the GDPR for processing personal data. The consent rule for storing or accessing information on a device is a separate rule in the ePrivacy Directive and PECR. It applies to the device access itself, and a marketing pixel does not fall within the strictly necessary exemption. The site needs consent for the pixel to set or read data, whatever the lawful basis for later processing.