Group: http://groups.google.com/group/adsense-api/topics
- update adunit [1 Update]
- add custom channel to adunit [1 Update]
- api for finding Google adsense code is present on the source code of the targeted url [1 Update]
- sorry chou <sorry.chou@gmail.com> Mar 04 08:15PM -0800
php client libraries example introduce how to update adunit using patch method,
but it will fail when change contentAdsSettings. backupOption.type
if you want change url to blank, always get error message "url must be
blank", but you can't not slove this problem even reassign
contentAdsSettings. backupOption.url = ""
we can using update method as follows
1. get old adunit
$old_adunit = $adSenseHost->accounts_adunits->get($accountid,
$clientid, $adunitid);
2. create new adunit object
$adUnit = new Google_AdUnit();
3. assign
$adUnit->setName($old_adunit['name']);
$adUnit->setId($old_adunit['id']);
$adUnit->setCode($old_adunit['code']);
$adUnit->setKind($old_adunit['kind']);
$adUnit->setStatus($old_adunit['status']);
and other parameters
4 $result=$adSenseHost->accounts_adunits->update($accountid, $clientid,
$adUnit);
update complete :)
- sorry chou <sorry.chou@gmail.com> Mar 04 07:36PM -0800
according to reference
https://developers.google.com/adsense/host/v4.1/accounts/adunits/getAdCode
*Optional parameters*hostCustomChannelIdstringHost custom channel to attach
to the ad code.
but when using php client libraries, this parameter should be an array as
follows
array('hostCustomChannelId', array('ca-host-pub-xxxx', 'xxxxx', ....))
:)
- Tony J <tonyjohn@gmail.com> Mar 04 01:34AM -0800
You just have to use any web socket classes to download the content of the
page and then do a simple string search to find the AdSense code. You will
have to parse the AdSense script you find in the page source.
You will NOT be able to use any AdSense APIs to do the same, but is a
simple task using any standard http classes, depending on the platform you
are using.
On Saturday, 23 February 2013 13:34:36 UTC+5:30, farrukh nadeem 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 adsense-api+unsubscribe@googlegroups.com.
To post to this group, send email to adsense-api@googlegroups.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.
No comments:
Post a Comment