Search code examples
trackingadsenseadsense-api

How to customize ads tracking of Adsense?


I know my question is relevant to Custom click tracking for adsense

but I am here asking it again because I need more answers of above mentioned question. only one answer already there, But it is not what I need. can u people re answer same question again please or answer this question?

Actually I want to show a line chart similar to google analytics showing how many times ads on mysite has been displayed and how many times the ads has been clicked. Can i achieve this?


Solution

  • have you tried this? i have answered on question referenced by you. my Answer: Even though there is no good way but it is quite easy to do so. First of all put your adsense code in a div like:

    <div id="adsDiv" class="adsDiv">
        <!--here your adsense code-->
    </div>
    

    now in your jquery code use this:

    $(".adsDiv").on("click", function(){
        setTimeout(function() {
            //here call to php function via ajax etc and in php you can easily check which user is currently online via session who clicked on ad.
        }, 5000);
    });
    

    note your php will function called after 5000 ms which means user has clicked and viewed your ad. you can increase or decrease it as per your need.