SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2008
    0 Post(s)
    0 Thread(s)

    Adsense: Is this possible?

    I wanted to know if its possible to get the ahref link that the adsense ads display on my site.

    For example an ad is displayed and if you mouseover a link will look like this:

    I'm looking for javascript or php code to retrieve these links either when the page loads or using a on mouseover event or something. I want to be able to store these links to my database so that i can see the &adurl's to see what type of ads are displayed around the world

    if this is possible i will pay someone to create the script. Budget $300.


  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Sydney, NSW, Australia
    25 Post(s)
    1 Thread(s)
    No it is not possible with JavaScript because the Google ads are in an iframe served from a different domain and are therefore inaccessible from JavaScript in your page. You would have to add to the JavaScript on Google's site to be able to do it with JavaScript.

    It isn't possible to do with any other language because at the time they all run the ad hasn't loaded yet.
    Stephen J Chapman, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts