O
O
Optimus2014-10-06 18:58:26
Internet advertising
Optimus, 2014-10-06 18:58:26

How to determine that the visitor cuts ads?

There are messages like "Your ads are blocked" - how is it determined, in JS or PHP? What mechanism underlies the definition?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita Gushchin, 2014-10-06
Pyan @marrk2

This is done in JS. I assume that by the phrase "cuts ads" you mean - removes or hides it from the page. If so, then with the help of JS we can check whether the blocks with ads are removed (or hidden) or not.
Like this:

if(    $( '#blockID' ).length == 0 
    || $( '#blockID' ).css( "display" ) == 'none' 
    || parseFloat($( '#blockID' ).css( "opacity" )) != 1.0)
{
    // Реклама удалена
}

S
Snewer, 2014-10-06
@Snewer

This is not explicitly defined in PHP. I think it's possible to check the existence of an ad unit on a page using JS. (search for, say, the selector $('#ads') )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question