Skip to content

Instantly share code, notes, and snippets.

@egibney
Created May 4, 2023 07:58
Show Gist options
  • Save egibney/372526e9fc39e7192b8fa230b5e7b9eb to your computer and use it in GitHub Desktop.
Save egibney/372526e9fc39e7192b8fa230b5e7b9eb to your computer and use it in GitHub Desktop.
$(function(){
let referral_url = new URL(window.location.href);
if (referral_url.searchParams.has('gclid') && referral_url.searchParams.has('via')) {
setTimeout(function(){
Cookies.remove('rewardful.referral', { path: '/', domain: window.location.hostname })
console.log(Cookies.get('rewardful.referral'))
console.log("Deleted referral cookie as visit came from Google Ads (forbidden by Terms of Service)")
}, 2000)
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment