0

i want to know if user clicks on ad showing on my website consider this is the code.

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AD Panel</title>
</head>
<body>
<div id="ads">
<!-- AdsTargets - Ad Display Code -->
<div id="data_3998">hello</div>
<script data-cfasync="false" type="text/javascript" async src="//adstargets.com/myAdstargets/display/items.php?3998&2518&0&0&4&1"></script>
<!-- AdsTargets - Ad Display Code -->
</div>

</body>
</html>

as you can see my ads script is placed inside a div with id ads. so i want to raise a alert() when anyone click on ads. NOT DIV. means if someone opens or click any ad inside the div alert should be raised automatically.

  • 3
    Generally this is impossible, as ad networks will embed an ` – Niet the Dark Absol Jul 12 '21 at 13:39
  • @NiettheDarkAbsol Although using built-in analytic tools of specified ad network is the correct approach, it is definitely possible to [detect iframe clicks](https://stackoverflow.com/a/23231136/2980864). – Kristián Filo Jun 16 '22 at 12:19

0 Answers0