Event tracking and consent mode: measuring what you are allowed to see, and estimating the rest
TL;DR
Difficulty: Intermediate
- Since 5 February 2026, UK regulation 6 covers anything your code stores on or reads from a device. Ads and conversion tracking still need a yes.
- Consent mode carries the banner's answer to Google's tags: four signals, a default of denied that must load first, and an update on every choice.
- Basic mode sends nothing on a no. Advanced mode sends cookieless pings, which is a risk decision under the new UK wording, not a default.
- Server side tagging moves the tags, not the obligation.
- Your own database counts every order. Use it to measure how refusers convert, because Google's modelling has thresholds most small shops never reach.
A British shop's tracking has to answer two questions at once: which campaigns sell, and what the code may do before a visitor says yes. I go through the UK rules as rewritten in 2026, set up Google's consent mode in the order that actually works, and use a Manchester coffee roaster's October to show how to estimate the sales your ad platform cannot see.
The point: measure what you are allowed to see, and know what you cannot
A shop wants to know which campaigns sell, and it wants to stay within the law. The two pull apart the moment a visitor presses reject. In my experience most setups settle it by accident: the tags fire before anyone presses anything, or the shop reads a dashboard that quietly lost a third of its sales.
This article is the engineering in between, with the arithmetic shown. The law in Germany and Austria is stricter and has its own article, on cookies and consent for shops selling into Germany and Austria. Here I stay with a British shop and British rules.
One invented business carries every example. Ardwick Roasters is a coffee roaster in Manchester run by Sam, selling beans and brewing kit online at ardwickroasters.example. Every number about it is made up. The law and the Google documentation are not, and they are footnoted.
An event is one thing a visitor did, written down
Analytics tools do not film a visit. They record small, named facts: viewed this product, added it to the basket, paid. Each fact is an event, with a name and a few parameters, such as which product and how much.
Google Analytics 4 (GA4) publishes recommended events for online shops, among them view_item, add_to_cart, begin_checkout, add_payment_info and purchase, and says that sending them with their prescribed parameters gives the most detail in reports.1 Use those names rather than your own.
The purchase event is the one that pays for everything else, so it is worth getting exactly right. Google's reference lists transaction_id and items as required, and value and currency as required whenever you want revenue to be computed. The transaction id is what stops a refreshed confirmation page counting the same order twice.2
Worked example: Ardwick's purchase event
A customer in Salford buys one 1kg bag of house espresso at £24.00 and a hand grinder at £45.00. Shipping is £4.50. Google says value should be the sum of price times quantity for the items, without shipping and tax.2 So:
Here is the number sent with the event, is the price of item , is how many of item were bought, and means add the result up over every item in the basket. It is a plain sum of products, and the summation sign is introduced in Foundations: the mean.
Step by step: , then , then . The shipping stays out. The event Ardwick's checkout page sends is:
gtag('event', 'purchase', {
transaction_id: 'AR-10482',
value: 69.00,
currency: 'GBP',
shipping: 4.50,
items: [
{ item_id: 'ESP-HOUSE-1KG', item_name: 'House espresso 1kg', price: 24.00, quantity: 1 },
{ item_id: 'GRD-HAND-01', item_name: 'Hand grinder', price: 45.00, quantity: 1 }
]
})
What UK law asks of the code that sends it
The British rule is regulation 6 of the Privacy and Electronic Communications Regulations 2003, PECR for short. Since 5 February 2026 it reads, subject to a new Schedule A1: a person must not store information, or gain access to information stored, in the terminal equipment of a subscriber or user.3 Terminal equipment is the visitor's phone or laptop.
The Data (Use and Access) Act 2025 rewrote that regulation through section 112, and widened it in a way that matters for anyone writing tracking code.4 Storing or accessing now includes instigating it, and gaining access now includes collecting or monitoring information automatically emitted by the device.3 So a pixel, local storage, a fingerprint and a script that reads the screen size all count, not just cookies. The Information Commission (the regulator was the ICO until September 2026, and its website still uses that name) says that regulation 6 applies whenever scripts and tags access or store information on a user's device.5
Schedule A1 holds the exceptions.6 Three matter for a shop. Strictly necessary storage for the service the visitor asked for, with examples written into the law, such as security, fraud prevention and keeping a record of what the visitor put into the site. A new statistical purposes exception: no consent is needed when the sole purpose is to collect statistics on how the site is used in order to improve it, the information is not shared beyond helping with that improvement, the visitor gets clear information, and the visitor is given a simple, free way to object and does not.6 And a new exception for the appearance and functionality of the site, with the same notice and objection conditions.6
The ICO narrows the statistical exception further. The output must be aggregate statistics that cannot identify people, it does not allow you to monitor or track individual visitors, it does not apply to anything related to online advertising, and a third party analytics provider must act as your processor, not as a joint controller.7 And on advertising it does not hedge: there are no advertising purposes that meet the strictly necessary exception, consent is needed for knowing whether a user clicked an advert, and consent is needed for connecting a visitor id to a purchase on your site, which the ICO calls conversions by name.7
The ICO's final guidance came out on 29 April 2026, and its separate review of regulation 6 for online advertising is still running.8 Until that changes the law, ad conversion tracking needs a yes.
Worked example: sorting Ardwick's tags into three piles
Sam's site sets or reads seven things.
- The basket cookie, once something is in the basket: strictly necessary, it records what the visitor put into the site.6
- The login session: strictly necessary.
- The cookie that remembers the consent choice: strictly necessary.
- A self hosted page counter that keeps only daily totals per page, shares nothing, is named in the privacy notice and has an opt out link: a candidate for the statistical exception, if every condition holds.67
- GA4: needs consent, unless Sam can show Google acts purely as his processor and nothing feeds advertising. With Google Ads linked to the same property, I would not try.
- The Google Ads conversion tag: needs consent. Conversions are named in the ICO guidance.7
- The Meta pixel: needs consent, for the same reason.
So three things run before the banner is touched, one more can run with a notice and an opt out, and three wait for a yes. Reject must be as easy as accept, and nothing outside the exceptions may be switched on in advance.9 Why nudging people into a yes is a liability is in the piece on dark patterns in consent design.
Consent mode is a messenger between the banner and the tags
The banner collects the answer. Consent mode is Google's interface for carrying it to every Google tag on the page, which then change their behaviour.10
There are four signals that matter for measurement and advertising.10
ad_storage: may advertising cookies be stored.analytics_storage: may analytics cookies be stored.ad_user_data: may user data be sent to Google for advertising.ad_personalization: may that data be used for personalised advertising.
The last two are what people mean by consent mode v2. Google added them as part of enforcing its EU user consent policy.11 That policy applies to end users in the European Economic Area, the UK and Switzerland. It requires legally valid consent for cookies where the law requires it, consent for personalised ads, and records of the consent you collected.12 It is a contract condition from Google, not a statute, but a British shop running Google Ads is bound by it all the same.
Google also lists functionality_storage, personalization_storage and security_storage as consent types.10 The old version of this article put one of those among the core signals and left out the two v2 signals. That was wrong.
Every page needs two commands. A default, which sets the state before anything is measured, and an update, which the banner sends the moment the visitor chooses.13
Worked example: Ardwick's default and update
On every page of ardwickroasters.example, at the very top of the head, before the Google tag:
window.dataLayer = window.dataLayer || []
function gtag() { dataLayer.push(arguments) }
gtag('consent', 'default', {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
wait_for_update: 500
})
Everything starts at denied, because in the UK nothing outside the exceptions may be pre enabled.9 The wait_for_update value is in milliseconds. It tells the tags to hold for half a second in case the banner loads slowly and has a stored answer to pass on.13 Google also lets you set a different default per region with an ISO 3166 code, which is useful when one site serves several countries with different rules.13 Sam sells in the UK only, so one default covers everyone.
Then, when a visitor presses accept, the banner calls:
gtag('consent', 'update', {
ad_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted',
analytics_storage: 'granted'
})
A visitor who accepts analytics but refuses advertising gets analytics_storage granted and the three advertising signals left at denied. The banner should send the update as soon as the visitor interacts with it, and on every later page it sends the stored answer again.13
Order is everything: the default must come first
Google's own documentation says it bluntly: the order of the code is vital, and if the consent code is called out of order, the consent defaults will not work. The default must run before any command that sends measurement data, such as config or event. For gtag.js the order is the default snippet, then the Google tag, then your consent tool.13
This is where I find most bugs. The GA4 tag fires on page view, the consent template a few milliseconds later, and in between the tag did what tags do. The banner looks perfect and the law is already broken.
Read the flow from the top. The first two boxes happen before the visitor has seen anything, and they are the ones that decide whether the setup is lawful. The decision box is the banner. Only after it do the tags act on a real answer. The last box is the reminder that the order exists in the shop's own database whatever the visitor pressed.
Worked example: finding the bug on Ardwick's product page
I open a product page in a private window with the network tab open, and do not touch the banner. Step one, I filter the requests for collect. One goes to GA4 at 140 milliseconds. Step two, I read its parameters. Consent mode encodes the storage state in a parameter called gcs, and the detailed state in gcd.10 If the first request shows analytics storage as granted, or if a _ga cookie appears in the storage tab before I press anything, the default came too late. Step three, I open Sam's Google Tag Manager container and find the cause: a trigger exception left over from a test stops the consent template firing on product pages. Step four, I remove it, reload, and confirm the first request now carries denied and no _ga cookie exists until I press accept. Ten minutes, and in my experience the most common fault in a British shop's tracking.
Basic and advanced consent mode send different things on a no
Consent mode comes in two shapes, and they differ most when a visitor refuses.10
In basic consent mode, the Google tags are blocked until the visitor interacts with the banner. If the visitor refuses, no data is transferred to Google at all, not even the fact that they refused.
In advanced consent mode, the tags load straight away with consent defaulting to denied, and while it is denied they send what Google calls measurements without cookies, usually called cookieless pings. Google lists what those pings contain: functional information such as a timestamp, the user agent and the referrer, whether the current or an earlier page in the session had ad click information in its URL, the consent state, and a random number generated on each page load.10 Google uses the pings to model the conversions it cannot observe, and says advanced mode gives an advertiser specific model rather than a general one.10
Here is the honest part for a UK shop. Since February 2026, regulation 6 explicitly covers collecting information automatically emitted by the device, and the ICO says scripts and tags are covered whenever they access information on it.35 A tag that loads before consent and sends the user agent onward is at least arguably accessing something. I found no ICO statement that blesses cookieless pings, and none that condemns them. So advanced mode is a risk decision the business makes knowingly, with its own adviser, not a box ticked because a blog said so.
Worked example: one visitor, two modes
A visitor from Stockport clicks an Ardwick ad, lands on the grinder page, presses reject, browses two more pages and buys the grinder for £45.00.
In basic mode: the Google tag never loads on any of the four pages. Google receives nothing. The ad click shows in Google Ads, the sale does not. Sam's database records the order.
In advanced mode: the tag sends a cookieless ping on each of the four pages, with the consent state, timestamp, user agent, referrer, an ad click flag and a fresh random number. No cookie is written, so no stored id joins the four. The sale is still not observed, though Google may model a share of sales like it if the account meets the thresholds below. Sam's database records the order. Either way Google Ads observes zero conversions here. The only difference is whether Google gets material to estimate with.
Server side tagging moves the tags, not the obligation
Server side tagging puts a tag server on your own domain between the browser and the vendors, and the server decides what to forward. Google recommends running the server on your first party domain, says you have full control over how the data is shaped and where it is routed, and says only you have access to the data in the server until you choose to send it elsewhere.14
That control is real. You can drop the IP address, remove parameters a vendor has no business seeing, and keep a vendor's script out of the browser. The ICO notes that server side tags can reduce tag activity on the device.5
What it does not do is change the law. The browser still runs code that sends events, so regulation 6 still applies to what happens on the device.35 The ICO also says operators using a server side tag manager must tell users about the third parties that receive the data.5 And the server must honour the same consent state the browser had. A tag server that forwards refused visitors to Meta because the pixel no longer runs in the browser has not solved a problem, it has hidden one.
It also costs money. Google's own Cloud Run guide prices each server at about 45 US dollars a month, recommends at least two instances so an outage does not lose data, and expects two to 10 servers to handle 35 to 350 requests per second.15
Worked example: what Ardwick's tag server costs and does
Sam's site gets about 1,000 sessions a day. At 20 events each that is 20,000 events a day, under one request per second, so two instances is simply Google's floor. Cost, from Google's figure: dollars a month, before any traffic charges, billed by Google in dollars.
What Sam gets for it: the tag server runs at tag.ardwickroasters.example. When a consented purchase arrives, the server forwards it to GA4 and to Google Ads with the click id, and to Meta, with the IP address removed. When a purchase arrives with advertising refused, the server forwards nothing to Google Ads or Meta. For a shop this size, my view is that a correct consent setup in the browser comes first, and a tag server is the second project, not the fix for the first. The full build is in my technical guide to server side tracking.
Your own database sees every order, so let it
A visitor who refuses cookies still places an order. The order is a contract between them and the shop, and the shop records it in its own database to fulfil it. That record does not depend on any tag.
That is the most useful fact in the subject. The platforms see the consented share of sales, the shop sees all of them. If the order also carries the consent state at the time of purchase, which the shop knows because it stores the choice in the strictly necessary consent cookie, then the shop can count consented and refused orders separately.
What the shop sends onward from those records is where my own rule comes in, and I state it as my practice, not as a reading of the law. A consented order goes to the platforms as the standard event, purchase, with its identifiers. A refused order is renamed out of anything an ad platform optimises or builds audiences from. It becomes purchase_nc, with no click id, no cookie id, no hashed email. It is never mapped to a conversion action and never eligible for a remarketing audience. Its only job is to make the total in the shop's own report match the database.
Why a rename rather than a flag: the people who run ad accounts change, and a different name is much harder to misuse by accident than a forgotten setting.
Worked example: Ardwick's October in the database
In October Sam's database holds 470 web orders. Each one carries the consent state stored at checkout. The query is a simple count grouped by that state:
SELECT ads_consent, COUNT(*) AS orders, SUM(item_total) AS revenue
FROM orders
WHERE completed_at >= '2026-10-01' AND completed_at < '2026-11-01'
GROUP BY ads_consent
It returns 372 orders with advertising consent granted and 98 with it refused. The 98 stayed in Sam's own reporting as purchase_nc. The total, 470, is October's truth, and it needs no model. If you want the data in a warehouse to join with campaign costs, the BigQuery setup for a Rails and Solidus shop shows the plumbing.
Estimating what the platforms cannot see
The database gives the total. The ad platform gives the consented part, tied to campaigns. Sharing the gap out between campaigns, or estimating it where orders carry no consent state, needs one honest assumption.
The old version of this article gave this formula, and it is a good one:
Here is the estimated total number of conversions, is the number observed from visitors who consented, is the number of sessions from visitors who refused, is the conversion rate of consenting sessions, and is how the refusers' conversion rate compares with the consenters', as a fraction. The term is a rate applied to a count, which is Foundations: ratios and rates, and choosing is a conditional probability question, which is Foundations: probability.
What the old version got wrong was the size of . It said typically ranges from 0.7 to 0.9. Google's own modelling page says consented users are typically two to five times more likely to convert than unconsented users, varying by consent rate, industry and conversion type.16 Two to five times more likely means between and . Either way, 0.7 to 0.9 overstates the hidden sales, so I have corrected it.
Worked example: Ardwick's October, estimated three ways
Sam's banner logs only the choice, counted in aggregate, so he knows that of 30,000 October sessions, 18,600 had advertising consent and 11,400 did not. The share who consented is:
is the consent rate, the consenting sessions and the refusing sessions. So , or 62%. The groundwork is Foundations: ratios and rates.
The consenting sessions produced the 372 observed orders. Their conversion rate is , or 2%.
If refusers bought at the same rate, , they would have produced orders, and the total would be .
At the top of Google's range, : , total .
At the bottom, : , about 46, total .
The database says 470.
The horizontal axis shows three estimates, each with a different , and the counted figure. The vertical axis is orders. From the same session counts the estimate moves from 418 to 600 on one assumption, and assuming refusers behave like consenters overstates the month by 130 orders. The database settles it.
It also lets Sam measure for his own shop instead of borrowing anyone's. Turn the formula round:
is the number of orders from refusing visitors, counted in the database, and and are as before. With October's numbers: . That sits inside Google's range of 0.2 to 0.5, which is reassuring, and it is Sam's number, not an industry average. Measured monthly, it tells him how far to scale up what the ad platform reports. Foundations: ratios and rates covers the rearrangement.
Google's modelling has thresholds a small shop may never reach
Google does fill some of the gap itself, but not for everyone. For Google Ads conversion modelling, its help page states a threshold of 700 ad clicks over a seven day period, per country and domain grouping. It describes the modelling as analysing observable data and historical trends, aiming to minimise over prediction, and gives one illustration: an advertiser with a 50% consent rate that recovered an 18% uplift in conversions from modelling.16
For GA4, behavioural modelling of refusing visitors needs consent mode in the advanced shape on every page, at least 1,000 events a day with analytics storage denied for at least seven days, and at least 1,000 daily users with analytics storage granted on at least seven of the previous 28 days. Even then eligibility is not guaranteed, and the modelled data only shows when the property's reporting identity is set to Blended.17
Worked example: is Ardwick eligible?
Google Ads first. Sam buys about 2,700 ad clicks a month, roughly 90 a day. Over seven days that is clicks. Whether you read Google's wording as 700 a day or 700 over the week, 630 falls short. No Ads modelling.
GA4 next. About 1,000 sessions a day, and 38% of them refuse, so about 380 refusing sessions a day. At around 20 events each that is denied events a day, comfortably over 1,000. But consenting users are about a day at most, and fewer as users than as sessions. That is under the 1,000 daily users Google needs. No GA4 modelling either.
So the modelled numbers agencies like to put in their decks will simply not appear for Sam. The estimate anchored on his own database is the only one he has, and in my experience that is true of most independent British shops.
What I would build, in order
If Sam came to me, I would do the work in this order.
- The loading order: consent default first on every page, then the Google tag, then the banner, tested page type by page type.
- The banner: accept and reject equally easy, nothing outside the exceptions on in advance, a footer link to change the choice, the choice stored for the order.9
- The event plan: Google's recommended names and a correct
purchase.12 - A knowing decision between basic and advanced mode, with the cookieless ping question put to the business's own adviser.
- The shop's own counting: consent state on every order, the renaming rule, and measured monthly against the database.
- Only if the shop needs the control, a tag server that honours the same consent state and names its third parties.514
None of this is exotic. It is careful plumbing, and it buys numbers Sam can set budgets on and a setup he can explain to the ICO without sweating. The strategy on top of it is in my piece on privacy first growth.