Pixel swapping
Pixel swapping (also called pixel piggybacking or container tag switching) is a technique where a tracking pixel is replaced with another one after it has been implemented. It is typically used fraudulently by dishonest affiliate partners to hijack conversions that belong to another channel.
What is pixel swapping?
Pixel swapping is a fraud technique in affiliate marketing and digital advertising where someone exploits access to an online store's tracking implementation to replace or manipulate tracking pixels. It can happen in several ways, but the basic principle is to take credit for conversions you did not generate.
How does it work?
The most common form of pixel swapping in affiliate marketing:
- An online store installs an affiliate's tracking pixel (for example, through a JavaScript tag)
- The affiliate changes the content of its tag so it loads other tracking elements, such as cookie stuffing scripts that overwrite other affiliates' cookies
- As a result, the affiliate is credited for sales it did not contribute to
It can also occur in more technical variants, where a container tag (such as a tag management tag) is used to load unauthorized tracking scripts on your online store.
Consequences
- Incorrect attribution: You pay commission on sales to the wrong partner. The real source of the traffic gets no credit.
- Higher costs: You pay twice: for the advertising that actually drove the traffic and to the affiliate that hijacks the conversion.
- Data impact: Your analytics data gets polluted, and you make marketing decisions based on incorrect data.
- Security risk: Unauthorized scripts can potentially collect customer data or introduce malware.
How to prevent pixel swapping
- Use Google Tag Manager: Centralize all tracking in GTM, where you have full control over which tags are loaded. Avoid giving external parties direct access to insert scripts into your code.
- Audit your tags regularly: Review all tracking scripts in your GTM container or source code at regular intervals. Look for tags you don't recognize.
- Server-side tracking: With server-side GTM, you have full control over what is sent to third parties. No external JavaScript can manipulate the tracking flow.
- Monitor affiliate performance: If an affiliate suddenly shows an unusually high conversion rate or takes credit for sales from branded searches, you should look into it.
- CSP (Content Security Policy): Implement Content Security Policy headers to restrict which domains can load scripts on your online store.
Related terms
- Cookie stuffing: The affiliate places cookies on the user's device without the user having clicked an affiliate link. If the user later makes a purchase, the affiliate is wrongly credited.
- Click injection: Mainly on mobile, where a malicious app registers a fake click event just before the user completes a purchase through an app install.
- Ad fraud: The broader category of fraud in digital advertising, which pixel swapping is part of.
How to do it in Shoporama
Guides that show the term in practice
Implement ecommerce tracking in a Shoporama theme
Developer guide to ecommerce tracking in a Shoporama theme: the data layer, Google Tag Manager, custom events, and...
Server-side tracking in Shoporama: GA4, Meta, and Google Ads
A complete guide to server-side tracking in Shoporama. Better data quality, fewer conversions lost to ad blockers,...
Set up Partner Ads affiliate marketing in Shoporama
An introduction to Partner Ads in Shoporama. Learn what the affiliate network is, what you get out of it, and how to...
We know online marketing at Shoporama
We have worked with online marketing ourselves for decades. As the only e-commerce platform in Denmark, we have spoken several times at conferences such as Marketingcamp, SEOday, Shopcamp, Digital Marketing, E-commerce manageren, Ehandelsdagen, Web Analytics Wednesday, and many more.