0

I'm creating a plugin for my site that logs my ad clicks.

One method that I have just thought about is to check if a request to a specific page was made. This is because once the ads start playing they always request data from a specific external web page.

Is it possible for me to do this? If it is please point me in the right direction.

a typical request looks something link this
http://neatlink.net/t/blank/blahblah-blah-blah

All of the requests are get requests.

That guy
  • 331
  • 1
  • 2
  • 11

3 Answers3

0

How about using a script tag that will attach an iframe to the webpage. Then to the page inside the iframe use $_SERVER['HTTP_REFERER'];

Johndave Decano
  • 2,101
  • 2
  • 16
  • 16
0

Just bind a click event to the ad and once it is clicked, make an ajax request to your script that logs the click.

See jquery.ajax().

Tomer
  • 17,787
  • 15
  • 78
  • 137
  • These are flash video ads. Do you still think your suggestion is valid ? – That guy Jul 26 '12 at 11:36
  • According to this: http://stackoverflow.com/questions/2701760/jquery-click-listener-on-object-in-ie-failing , flash will 'swallow' the click event, but you can try wrapping it in div and bind a click on the div. – Tomer Jul 26 '12 at 11:43
  • Ok that sound reasonable. But does that mean the div would have to be placed on top of the player ? – That guy Jul 26 '12 at 11:47
  • just wrapping the player object:
    – Tomer Jul 26 '12 at 11:51
  • Ok I think I've actually tried that. I added an this to the div onclick="alert('You just clicked this video')" but the alert never showed up... How am I supposed to know if it works before I start writing some more advanced code ? – That guy Jul 26 '12 at 11:58
  • Well, if you tried it and it didn't work then i guess it doesn't work... you should edit your question and mention the ad is a flash script. – Tomer Jul 26 '12 at 12:03
0

You can use Ajax object .There you can check if callback is called for readyState = 4 then it is ensured that a specific call is made.

radhe001
  • 324
  • 1
  • 3
  • 16