See whether google ads have been loaded on a page

Discussion in 'PHP' started by Danny, Jul 6, 2006.

  1. #1
    Is there any php or other code that I can use to check if google ads have been loaded and if so set a variable.

    Scenario:

    - I use a banner system to dynamically load google ads
    - I include another page into my script via cURL and other methods

    essentially i want a script that reads the page contents, sees if google ads is loaded, and if it is sets a variable that I can parse.

    Any ideas?

    Daniel
     
    Danny, Jul 6, 2006 IP
  2. acplus

    acplus Guest

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You may have to use Javascript for accessing the document objects. This was you could search for Google Adsense code.

    Alternatively, if you are using CURL with PHP why not iterate through the document as you are fetching it from a remote location. You could search for the Google Adsense code. This method is prefered as there isn't an easy for interacting between PHP and Javascript without reloading the webpage.

    Hope this helps.

    Regards,
    AcPlus
     
    acplus, Jul 7, 2006 IP
  3. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You may be able to attach some kind of onload to the adsense that triggers an ajax call when the adsense loads.
     
    mad4, Jul 7, 2006 IP
  4. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Use PHPAdsNew and limit ads by number already shown.
     
    T0PS3O, Jul 7, 2006 IP