All Collections
How to block referrals from Google Ads
How to block referrals from Google Ads
Emmet Gibney avatar
Written by Emmet Gibney
Updated this week

If you wish to prevent affiliate referrals coming from Google Ads you can add a short piece of JavaScript to your website to remove the cookie that gets placed for these referrals.

Simply add this JavaScript snippet below the Rewardful Tracking snippet in the <head> section of your website.

<script src=""></script>

let referral_url = new URL(window.location.href);
if (referral_url.searchParams.has('gclid') && referral_url.searchParams.has('via')) {
Cookies.remove('rewardful.referral', { path: '/', domain: window.location.hostname })
console.log("Deleted referral cookie as visit came from Google Ads (forbidden by Terms of Service)")
}, 2000)

If you do this it is also advisable to add a clause to your affiliate program's terms of service that makes it clear to your affiliates that this behaviour is prohibited.

Did this answer your question?