Sub topic 11
Consent and Privacy Rules
This chapter assumes you can read basic HTML and JavaScript, know what an email service provider (ESP) does, and have built the sign-up form from the earlier chapters. It covers what the law expects when you collect an email address, and how to turn those expectations into form design and stored records. It is a practical guide, not legal advice. Check the rules that apply to your audience with a qualified person before you launch.
Why consent shapes the form
Every field on a sign-up form is personal data. An email address identifies a person, so privacy law treats it as something you must collect for a stated purpose, with a lawful basis, and be able to prove later.
Three regimes come up most often for list building:
| Regime | Applies when | Core rule for email marketing |
|---|---|---|
| GDPR (EU and UK GDPR) plus ePrivacy rules | You offer goods, services, or content to people in the EU or UK, or monitor them | Marketing email needs a lawful basis, usually freely given, specific, informed, unambiguous consent |
| CAN-SPAM (United States) | You send commercial email to US recipients | Opt-out model: no deceptive headers or subjects, a physical postal address, and a working unsubscribe honored within 10 business days |
| CASL (Canada) | You send commercial electronic messages to Canadian recipients | Express or implied consent before sending, identification of the sender, and an unsubscribe mechanism |
Other places, such as Brazil (LGPD), Australia (Spam Act), and several US states, have their own rules. A sensible design is to meet the strictest standard you are likely to face, then use it for everyone. That is simpler than showing different forms by country.
What valid consent looks like
Under GDPR, consent must be:
- Freely given. The visitor can say no without losing something unrelated. You may not make a newsletter tick-box a condition of, say, completing a purchase.
- Specific. Consent covers one purpose. "Weekly newsletter" and "share my details with partners" are separate purposes and need separate choices.
- Informed. The visitor knows who you are and what they will receive before they submit.
- Unambiguous. It takes a clear affirmative act. A pre-ticked box, silence, or continued scrolling does not count.
The consent checkbox in the earlier form follows these points: it is unticked, it names the content ("the weekly newsletter"), and it states that the visitor can unsubscribe at any time.
<label>
<input type="checkbox" name="consent" value="yes" required>
I agree to receive the weekly newsletter and can unsubscribe at any time.
</label>
<p class="form-note">
We use your email only to send the newsletter.
See our <a href="/privacy">privacy policy</a>.
</p>Keep the privacy policy link next to the checkbox. The policy should name your organization, state the purpose, say how long you keep the data, list the ESP as a processor, and explain how to withdraw consent or ask for deletion.
Consent by form type
The same rule applies to every placement, but each type tempts you to cut corners.
- Inline forms. Easy to get right. Place the checkbox and notice above the button.
- Pop-ups and slide-ins. Space is tight, so teams often drop the notice. Keep a short statement and a link. A pop-up that adds people on a single "Subscribe" click, with no consent statement, is a common compliance gap.
- Sticky bars. Same as pop-ups. If the bar has only an email field and a button, put a one-line notice under the button, or open a dialog with the full form.
- Checkout and account forms. The newsletter box must be separate from terms of service and unticked.
Bundled consent and lead magnets
Offering a free checklist in exchange for an email is allowed, but the offer must be honest about what the visitor gets. If the form says "Get the checklist" and then silently subscribes people to a weekly newsletter, the consent is not specific or informed. State both: "Send me the checklist and the weekly newsletter." If you want to let people receive the checklist without joining the list, offer that choice as an unticked box.
Recording consent
Under GDPR you must be able to demonstrate consent. A subscribed flag in your ESP is not enough. Store, for each subscriber:
- The email address.
- The date and time of consent, in UTC.
- The exact consent wording shown, or a version identifier that maps to it.
- The form or page URL where it was given.
- How it was given (checkbox, double opt-in link click).
- Optionally, the IP address, if your policy explains why you keep it.
The server should write this record when it receives the form. Do not trust a value only set in the browser.
// Node.js (Express) handler that records consent evidence.
import express from 'express';
const app = express();
app.use(express.urlencoded({ extended: false }));
const CONSENT_TEXT_VERSION = 'newsletter-v3';
app.post('/subscribe', (req, res) => {
const { email, consent, website } = req.body;
if (website) return res.status(204).end(); // honeypot filled: ignore
if (consent !== 'yes') {
return res.status(400).send('Consent is required.');
}
if (typeof email !== 'string' || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
return res.status(400).send('Enter a valid email address.');
}
const record = {
email: email.trim().toLowerCase(),
consentedAt: new Date().toISOString(),
consentTextVersion: CONSENT_TEXT_VERSION,
sourceUrl: req.get('referer') || 'unknown',
method: 'form-checkbox',
status: 'pending-confirmation'
};
console.log('Store this in your database:', record);
res.status(202).send('Check your inbox to confirm.');
});
app.listen(3000, () => console.log('Listening on http://localhost:3000'));The handler checks consent on the server even though the HTML has required. A script or a modified form can skip browser validation. It also marks the record pending-confirmation, which sets up double opt-in, covered in the next chapter.
Whenever you change the consent wording, bump the version string and keep the old text. Otherwise you cannot show what an earlier subscriber agreed to.
Cookies, tracking, and pop-up scripts
Pop-up tools often set cookies or use localStorage to remember who dismissed a pop-up. In the EU and UK, the ePrivacy rules require consent before storing non-essential data on a visitor's device. Regulators have generally accepted that a value used only to avoid re-showing a prompt is low risk, but the exact treatment varies by country. Two habits keep you safer:
- Store the minimum. The frequency-cap script from the earlier chapter saves only a timestamp, not an identifier.
- Do not load third-party pop-up or analytics scripts that set tracking cookies until the visitor has agreed through your cookie banner, if you serve regions that require it.
If you use a hosted pop-up vendor, confirm in its documentation what it stores and whether it is configured to wait for cookie consent.
Unsubscribe, access, and deletion
Consent can be withdrawn at any time, and withdrawing must be as easy as giving it. Include an unsubscribe link in every email, and make it work in one click without requiring a login. Under CAN-SPAM, honor the request within 10 business days. Under GDPR, stop sending promptly, and treat it as a right to be handled without undue delay.
People may also ask what you hold about them or ask you to erase it. Keep a short written process: who receives the request, how you verify identity, and how you delete the subscriber from the ESP and any exported spreadsheets. Retain a minimal suppression record (a hash of the address is a common approach) so you do not re-add the person from an old import.
Children and sensitive contexts
GDPR sets a lower age limit for giving consent online, between 13 and 16 depending on the country. In the US, COPPA restricts collecting data from children under 13. If your audience may include minors, such as a school or games site, do not market to them by email without legal guidance. Never ask for sensitive data (health, religion, and similar) in a sign-up form unless it is essential and you have specific legal advice.
Common mistakes
- Pre-ticked boxes. Invalid consent under GDPR, and a red flag elsewhere.
- Buying or renting lists. Those people never consented to you. Do not upload them.
- Treating a business card as consent. Under CASL and GDPR, handing over a card is not always agreement to marketing. Ask.
- Silent re-subscription. Adding past customers or unsubscribed contacts to a new list.
- Hiding the unsubscribe link. A tiny gray link that is hard to find leads to spam complaints, which hurt deliverability as well as compliance.
- Changing the purpose. Consent to a newsletter does not cover selling the address to partners.
Summary of a compliant form
A form ready for launch should have:
- An unticked, specific consent checkbox or equivalent clear statement.
- A named purpose and a link to the privacy policy at the point of collection.
- A server-side check and a stored consent record with a wording version.
- An unsubscribe link in every email, plus a process for access and deletion requests.
- No third-party scripts that set tracking cookies before the visitor agrees, where required.
Exercise
A pop-up says "Get 10% off" with an email field and a Subscribe button. Submitting it adds the address to the weekly newsletter. The form has no other text. Name two problems with respect to consent, and describe how you would fix them.
Show answer
First, the consent is not informed or specific: the visitor is not told they will receive a weekly newsletter, only that they get a discount. Second, there is no clear affirmative act and no link to a privacy policy, so you cannot show valid consent. Fix it by adding a line such as "Send me the discount code and the weekly newsletter" with an unticked checkbox (or a clear statement beside the button, where the law of your audience allows it), linking the privacy policy, validating consent on the server, and storing the timestamp, wording version, and source URL.
Exercise
Why should the server, not only the HTML required attribute, check that consent was given?
Show answer
The required attribute runs only in the browser. A script, a modified form, or a direct HTTP request can send a submission without consent. Only a server-side check guarantees that every stored subscriber has a consent record.