Even if there is no good way, but it is quite easy to do. First of all, put your adsense code in a div as:
<div id="adsDiv" class="adsDiv"> </div>
now in your jquery code use this:
$(".adsDiv").on("click", function(){ setTimeout(function() {
Please note that your php function will be called after 5000 ms, which means the user clicked and viewed your ad. You can increase or decrease it according to your needs.
source share