A shopper copies a discount code, closes your page, and buys later. Who earned the referral? Cookie stuffing can give that credit to someone the shopper never chose to visit. The sale is real. The referral isn’t. For a coupon-site owner, the difficult part is spotting both deliberate abuse and innocent-looking interface choices that produce the same hidden tracking requests.
couponPHP is a self-hosted PHP coupon and deal website script with outgoing-click reporting and copy-code popups. Those features make the distinction between a coupon interaction and a merchant visit relevant: your logs should record what happened, while your interface should explain what will happen.
What is cookie stuffing, technically?
A tracking system can mistake a browser request for a recommendation. Say a shopper reads a gardening coupon page without clicking any store link. A hidden request carrying an affiliate identifier could still create referral credit for a later purchase. Cookie stuffing exploits that mistake; it’s also called cookie dropping.
A cookie is stored data, not executable code. Under the IETF’s HTTP cookie standard, RFC 6265 (2011), a server can send a Set-Cookie response header, and the browser later sends applicable cookies back. You can’t use your unrelated coupon domain to set a retailer’s cookie directly. [1]
That’s why the workaround is a request to the retailer or affiliate tracking endpoint itself. That response may set the attribution cookie if browser policy permits it. In a last-click program, the latest eligible referral can replace an earlier one; the cookie window is the period during which a referral may qualify for commission.
You’ll get a clearer operating rule by auditing requests rather than cookie counts: no affiliate referral request until the shopper deliberately chooses the relevant merchant visit. Browser blocking doesn’t turn an unsolicited request into a legitimate referral. Program terms still govern what qualifies.
How hidden referrals reach the browser
An unfamiliar script can turn a harmless page component into a referral generator. A visitor counter, for example, might load something other than its visible graphic. You’ll need to follow network activity, because what appears on screen doesn’t reveal every request.
Hidden iframes and image requests
An iframe embeds another page. If it loads an affiliate URL invisibly, the tracking server may receive a referral request without a visible merchant visit. An image or script URL can also initiate a request that reaches a tracking endpoint.
Chachra, Savage and Voelker’s 2015 academic study documented iframe, image and redirect techniques. [2] For your site, approved widgets should have known destinations. Removing an unexplained tracking request addresses the mechanism; merely hiding or shrinking its display doesn’t.
Pop-unders and misleading coupon buttons
A pop-under opens a window behind the current one. Say a visitor clicks “Copy code,” but your page also opens a merchant tracking link out of sight. The visitor did interact with the page, yet that interaction didn’t clearly request a store visit.
Separate “Copy code” and “Visit store” controls reduce that ambiguity. If a combined action is permitted, its label should say “Copy code and visit store,” and the merchant destination should be visible. You’ll spend a little interface space. It’s worth the clearer evidence of intent.
Forced redirects
A redirect moves a browser request to another URL. It’s normal for an affiliate link to pass through tracking before reaching the store. Trouble starts when that chain runs on page load, a timer, or an unrelated interaction.
The 2015 study documented redirects to affiliate URLs without explicit clicks. [2] Your implementation should reserve that chain for the named store control and exclude it from hover handlers, automatic coupon reveals and unrelated navigation. A legitimate redirect has a relevant starting action.
Browser extensions
A shopper may reach a retailer by typing its address, while an extension rewrites the request to include an affiliate identifier. Kapravelos and colleagues documented extension-based URL changes and injected affiliate iframes in their 2014 USENIX paper. [3]
Your website can’t control everything installed in a visitor’s browser. You can avoid distributing extensions that claim unrelated purchases, require partners to explain their attribution behavior, and compare suspicious journeys with an extension-free browser. That comparison helps separate your own code from outside interference.
What the eBay cases actually established
Retelling a fraud case can create a second attribution mistake: treating every commission paid as proven fraudulent income. We shouldn’t collapse the eBay cases into a combined headline total.
Wikipedia’s account records that Shawn Hogan pleaded guilty to a wire-fraud charge and received a five-month prison sentence and a $25,000 fine in 2014. [4] Those are established outcomes, not a reason to repeat disputed claims about who taught whom.
The U.S. Department of Justice’s August 4, 2014 release says Brian Dunning received a fifteen-month prison sentence, followed by three years of supervised release. He pleaded guilty on April 15, 2013, admitting a scheme operating approximately between May 2006 and June 2007. [5]
The same release distinguishes approximately $5.2 million in commissions paid to his company from the $200,000–$400,000 stipulated as fraudulent commissions for sentencing. Calling the whole $5.2 million an established fraud loss erases that distinction.
Dunning’s downloadable website applications contained code that caused visitors’ browsers to receive his company’s affiliate cookie without clicking an eBay link or seeing eBay content. The browser was redirected to a tracking server without the visitor realizing it. [5]
For your own supplier reviews, “free widget” isn’t a sufficient explanation. A developer should be able to account for each outbound destination and its trigger. Useful visible functionality doesn’t excuse an undisclosed referral in the background.
Why legitimate coupon sites lose twice
A coupon page can help a shopper and still lose the commission. Where a program accepts the latest qualifying referral, a later stuffed identifier may displace the genuine source. The 2015 study describes this overwrite risk. [2] Merchants may also pay for purchases the dishonest affiliate didn’t influence.
Say a hypothetical Leeds coupon site loses credit for twelve qualifying £80 orders at a 5% commission rate. The missing revenue is 12 × £80 × 0.05 = £48. That’s an illustration, not a measured industry loss.
The second loss is worse decision-making. A page’s EPC—earnings per outgoing click—can fall even if its coupons remain useful. You might retire the page or cut promotion because the attribution report understates its contribution.
You’ll get a better diagnosis by comparing recorded store visits, approved commissions and reversals, using the definitions in your affiliate marketing metrics. Unexpected movement isn’t proof of abuse. Low conversion can also reflect expired offers, tracking failures or different shopper intent. Your last-click attribution rules explain which later actions can legitimately change credit.
An outgoing-click setup you can defend
A combined coupon popup can produce logs that say “click” when all the shopper did was reveal a code. If a network questions your referrals, that vague event name won’t explain the journey.
A cleaner flow keeps browsing and code copying local. The shopper then activates a clearly labelled store link; your outgoing endpoint resolves the approved offer, records the event, and redirects through that merchant’s authorized tracking URL.
Here’s how your developer can make that separation explicit:
- Distinct events: coupon view, code reveal, code copy and merchant visit have different names. This prevents interface engagement from masquerading as a referral.
- Controlled destinations: the server resolves an offer ID to an approved URL rather than accepting an arbitrary destination parameter. That reduces open-redirect abuse and makes changes reviewable.
- No background referral calls: previews, prefetching, cached-page refreshes and feed imports don’t call browser-facing affiliate referral URLs. They aren’t shopper visits.
- Separate consent controls: accepting tracking cookies doesn’t activate affiliate links. Privacy permission and a merchant referral are different actions.
A browser-extension-free test still doesn’t guarantee that a public endpoint will never be requested by a bot. A click log can’t prove human intent either. For stricter routing, a developer can use a local confirmation page and short-lived, session-bound authorization before the redirect; that adds friction and can disrupt new-tab behavior, so you’ll need accessibility testing.
Your affiliate disclosure should explain the financial relationship. It doesn’t repair a misleading control or substitute for compliance with the affiliate program’s rules. The strongest evidence combines clear wording, permitted behavior and a traceable request chain.
Test the journey before approving a release
A redesign can reintroduce tracking you removed. For example, a new performance plugin might prefetch links before visitors activate them. A screenshot review won’t catch that.
You can catch it with this repeatable browser test:
- With developer tools open in a clean profile, load a store page without interacting and preserve the network log. You shouldn’t see requests to affiliate referral endpoints.
- Scrolling, accepting or rejecting cookie choices, revealing a coupon and copying its code shouldn’t trigger referrals through separate local controls.
- After activating “Visit store,” you’ll have a chain to inspect: the initiating element, tracking parameters and redirects. It should reach the advertised merchant without unrelated affiliate detours.
- Repeating the test with keyboard navigation, JavaScript disabled where supported, and the production mobile layout covers different conditions. Browser protections vary, so one configuration isn’t enough.
A useful outgoing record includes a timestamp, offer ID, originating page, destination and deployment version. Where the network supports a sub-ID—a reference carried into its reports—you can use a non-personal event reference to reconcile the journey. Logs shouldn’t store unnecessary visitor data; retention should follow your privacy commitments.
Raw outgoing totals may include crawlers and retries. Your reporting should identify those separately rather than quietly labelling every request a shopper click.
Frequently asked questions
Is cookie stuffing illegal?
The eBay cases show that it can lead to wire-fraud convictions. [4] [5] But a suspicious request alone doesn’t establish intent or prove a crime. Affiliate terms and privacy obligations require separate assessment. If your test exposes automatic referrals, stopping that flow, preserving the evidence and discussing it with the program is more useful than assuming a disclosure makes it acceptable.
Can a copy-code button trigger affiliate tracking?
A shopper who presses “Copy code” reasonably expects a clipboard action. A concealed store visit creates a mismatch. Separate copying and visiting controls avoid that ambiguity. A combined flow needs program permission and a label that explains both effects before activation. Testing the actual requests still matters: correct wording won’t help if the merchant link also fires on page load or popup dismissal.
Does blocking third-party cookies prevent this fraud?
RFC 6265 allows browsers to reject third-party cookies. [1] That can defeat some embedded attempts, but a top-level navigation uses a different context, and extensions can alter requests. Your audit should therefore inspect unsolicited referral requests even when no cookie survives. If the request fires before a store choice, you’ll still need to fix its trigger. Testing in a clean browser helps identify your site’s behavior; it can’t certify every visitor’s browser environment.
References
- IETF RFC 6265: HTTP State Management Mechanism, 2011
- Chachra, Savage and Voelker: Affiliate Crookies, 2015
- Kapravelos and colleagues: Hulk, USENIX Security, 2014
- Wikipedia: Cookie stuffing and the Shawn Hogan case
- U.S. Department of Justice: Brian Dunning sentencing, August 4, 2014
Make copying a code a zero-referral action
If your release test records affiliate tracking when someone merely copies a code, the flow still needs work. You can’t promise how every browser extension or network reviewer will behave. You can make your own site consistent: copying copies, visiting visits, and the log distinguishes them. That zero-referral copy test gives your developer a specific acceptance criterion for the next deployment.
