Pixel swapping
Pixel swapping (also called pixel piggyback or container tag-switching) is a technique where one tracking pixel is replaced with another after implementation - typically used fraudulently by dishonest affiliates to hijack conversions belonging to another channel.
What is pixel swapping?
Pixel swapping is a fraudulent technique used in affiliate marketing and digital advertising, in which someone exploits access to an online store’s tracking implementation to replace or manipulate tracking pixels. This can happen in several ways, but the basic principle is to take credit for conversions that one did not generate.
How does it work?
The most common form of pixel swapping in an affiliate context:
- An online store installs an affiliate’s tracking pixel (e.g., via a JavaScript tag)
- The affiliate modifies the content of their tag so that it loads other tracking elements—such as cookie-stuffing scripts that overwrite other affiliates’ cookies
- As a result, the affiliate is credited for sales they did not contribute to
It can also occur in more technical variants, where a container tag (e.g., 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 actual source of the traffic isn’t credited.
- Increased costs: You pay twice—for the advertising that actually drove the traffic and for the affiliate that hijacks the conversion.
- Data corruption: Your analytics data is compromised, 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 third 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 brand searches, you should investigate.
- 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 on an affiliate link. If the user subsequently makes a purchase, the affiliate is credited improperly.
- Click injection: Primarily on mobile devices, where a malicious app registers a fake click event just before the user completes a purchase through an app installation.
- Ad fraud: The broader category of fraud in digital advertising, of which pixel swapping is a part.
How to Use Shoporama
Guides that demonstrate the concept in practice
Implement tracking in a Shoporama theme
Developer Guide to E-commerce Tracking in a Shoporama Theme: Data Layer, Google Tag Manager, Custom Events, and...
Server-side tracking in Shoporama
A Complete Guide to Server-Side Tracking in Shoporama. Better data quality, fewer ad-blocker losses, product IDs that...
Set up Partner Ads in Shoporama: getting started
Introduction to Partner Ads in Shoporama. Understand what it is, what you get out of it, and get started quickly with...
We know online marketing in Shoporama
We've been working with online marketing ourselves for decades. As the only shop system in the country, we have spoken multiple times at conferences such as Marketingcamp, SEOday, Shopcamp, Digital Marketing, E-commerce Manager, Ecommerce Day, Web Analytics Wednesday and many more.