Cookie switch / tracking switch 

Tracking switch (cookie switch): who a conversion belongs to

Three people sit at a table looking at a laptop. One woman gestures as she explains.
Ralph Grundmann · Last updated on 19 October 2026

A tracking switch, also called a cookie switch, decides for each purchase or enquiry which marketing channel the conversion is assigned to and fires only that channel’s conversion tag. This stops Google Ads, Meta and affiliate networks from counting the same sale several times, and commissions go only to the partner entitled to them. Here you can find out how a switch works, which rules are common and what data protection requires.

Why you need a tracking switch

A customer clicks a Google ad, comes back a week later through a voucher partner and buys. Without a switch, both systems report the sale as theirs: Google Ads counts a conversion, the affiliate network does too, and the shop pays a commission for a sale it also credits to the ad. Added up across all ad systems, there are more sales than actually happened.

This shows most clearly in affiliate marketing, because money is paid for every reported conversion. The switch ensures that each conversion belongs to exactly one channel.

How a tracking switch works

  1. Detect the touchpoint: on each visit the switch reads where someone comes from: UTM parameters, click IDs from ad systems, affiliate network parameters or the referrer.
  2. Store the touchpoint: channel and time are stored in the browser, usually in a cookie or in local storage. Hence the name cookie switch.
  3. Apply the rule: at the conversion, the switch reads the stored touchpoints and decides by a fixed rule which channel wins.
  4. Fire only the winner: the switch fires that channel’s conversion tag or passes the channel to the tag. Many affiliate networks provide a channel parameter in their conversion tag so they can tell whether the sale is theirs.

It can be built in the shop system, in Google Tag Manager or with server-side tracking on your own server. In Tag Manager, the switch consists of variables that read and store the channel and of triggers that fire only the matching tag depending on the result.

Common rules

  • Last click: the last channel before the conversion wins. This is the most common rule in affiliate marketing.
  • First touch: the first channel wins, later touchpoints change nothing.
  • Exceptions for direct visits: the rule sets how a direct visit counts, that is when someone types the address or uses a bookmark. Often a later direct visit should not displace a paid channel. Some switches instead let a direct visit win if it was the first touchpoint. Then no later channel counts.
  • Lifetime: how long a touchpoint stays valid, for example 30 days, should match the agreements with your partners.

The switch makes a decision for commissions and bidding. It does not answer how much each channel contributed. That is the job of the attribution model in web analytics. It makes sense to pass all touchpoints to GA4 as an event as well, so supporting channels stay visible.

If the switch stores information on the device, for example in a cookie, Section 25 of the German TDDDG applies. Without consent this is only allowed under the exceptions in paragraph 2, above all where it is strictly necessary for the provider to deliver a service the user has explicitly requested. Assigning conversions to ad channels therefore usually requires consent. The same applies to cookieless methods that read device characteristics. Clarify the assessment with your data protection officer.

The switch must also work together with your consent solution: if consent for a channel is missing, its tag must not send as if consent had been given, even if the rule would make the channel the winner. For Google tags, Consent Mode v2 controls what is sent without consent: in basic mode the tag stays blocked, in advanced mode it only sends cookieless pings. For all other channels the switch itself must check consent.

Testing the switch

  • Test purchases per channel: use test links for each channel, in different orders, and check which tag fires. Tag Manager’s preview mode shows the decision step by step.
  • Reconcile the numbers: the sum of conversions across all ad systems should not exceed actual orders. If it is clearly higher, a channel is counting twice.
  • Re-check after changes: new partners, new parameters or a new checkout change the basis of the switch. Every rebuild of your tracking should therefore include a check.


 Your next step 

Would you like to avoid duplicate conversions and commissions?

Our page Google Tag Manager tracking switch explains how we work. In an initial consultation, we clarify what makes sense for your website.


Request a consultation
 Frequently asked questions 

What is a cookie switch?

A set of rules that decides at a conversion which marketing channel it belongs to and fires only that channel’s conversion tag. The name comes from the touchpoints usually being stored in a cookie.

Is a tracking switch the same as attribution?

No. The switch decides which channel gets the conversion reported, for example for the commission. An attribution model assesses, for analysis, how much each channel involved contributed to the conversion.

Does a tracking switch need consent?

If it stores or reads information on the device, Section 25 TDDDG applies. Assigning conversions to ad channels then usually requires consent.

Who needs a tracking switch?

Any company that uses several paid channels and pays at least one of them per conversion, especially online shops with an affiliate programme.

 Request a consultation 

Questions about this topic?

Tell us briefly what it is about. You will speak directly to Ahmed Badia.
Microsoft Partner Badge
SISTRIX-zertifizierte Agentur
4.9
Based on 32 reviews

Reviews from our Google Business Profile. We check every review against our client projects.

Request a consultation
Ahmed Badia
Ahmed BadiaSenior Software Developer Team LeadCall: +49 228 243 313 54

* Required

Please enter your name.

Please enter a valid email address, e.g. name@company.com.

For a call back.

Please enter your number with area code, e.g. +49 228 243 313 53.

Please tell us briefly what it is about.

Free and without obligation. We usually reply on the same working day.

Information on how we process your data: Privacy policy