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
- 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.
- Store the touchpoint: channel and time are stored in the browser, usually in a cookie or in local storage. Hence the name cookie switch.
- Apply the rule: at the conversion, the switch reads the stored touchpoints and decides by a fixed rule which channel wins.
- 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.
Data protection and consent
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.
