- Generating Ads with PHP [2 Updates]
- Sean <firstname.lastname@example.org> Apr 11 06:15PM -0700
I'm not sure if I'm missing something with this, but I'm having problems
generating ads with php and the v4.1 AdSense host.
I have all the access and refresh tokens up and running correctly, got the
link set up between the user and all that set up. Now I'm trying to create
ads for my test user.
You need to create ads first with the insert statement first, then get them
with the generateAdCode function correct?
I copied this out of the example PHP code, doing a print_r it all seems to
$adUnit = new Google_AdUnit();
$contentAdsSettings = new Google_AdUnitContentAdsSettings();
$backupOption = new Google_AdUnitContentAdsSettingsBackupOption();
$contentAdsSettings->setSize('SIZE_600_160'); //width then height
$customStyle = new Google_AdStyle();
$colors = new Google_AdStyleColors();
$font = new Google_AdStyleFont();
This is the insert statement I'm running: ($pubID is the users pubID,
$clientID is the app client ID for the project) (I think that is correct
$result = $adsensehostService->accounts_adunits->insert($pubID, $clientID,
This is the error I'm getting
*Fatal error*: Uncaught exception 'Google_ServiceException' with message
'Error calling POST
(404) Ad client not found.'
I've been trying to figure out what the Ad client not found means, or if
I'm even on the right track for making ads.
Any help would be appreciated.
- "Jose Alcérreca (AdSense API Team)" <email@example.com> Apr 12 02:00AM -0700
Ad clients are something else:
Just list them to get your ad client id. Look for "AFC" as it's most likely
the product code you will be using.
Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W
Registered in England Number: 3977902
Google Inc.| Developer Relations | *AdSense API Team* |
On Friday, 12 April 2013 02:15:40 UTC+1, Sean wrote:
You received this message because you are subscribed to the Google Group adsense-api.
You can post via email.
To unsubscribe from this group, send an empty message.
For more options, visit this group.
You received this message because you are subscribed to the Google Groups "AdSense API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To post to this group, send email to email@example.com.
Visit this group at http://groups.google.com/group/adsense-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.