Nuke the affiliate cookie when affiliates run Google Ads
If you have an affiliate program... And your affiliates run ads against your branded keyword (like "ShipFast") Use this script to nuke the affiliate cookie (code below)

@marclou · Apr 6, 2024
// Nuke 'em all useEffect(() => { let referral_url = new URL(window?.location?.href);
- 3 likes

@marclou · Apr 6, 2024
if ( referral_url?.searchParams?.has("gclid") && referral_url?.searchParams?.has("via") ) { setTimeout(function () { document.cookie = "rewardful.referral=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=" + window.location.hostname;
- 6 likes

@marclou · Apr 6, 2024
console.log( "Deleted referral cookie as visit came from Google Ads (forbidden by Terms of Service)" ); }, 2000); } }, []);
- 6 likes

@marclou · Apr 6, 2024
I share everything I learn as a solopreneur every Saturday morning: How to find startup ideas, launch fast, and get profitable ↓ marclou.beehiiv.com
- 25 likes





