Hi All,
I want to manage Adwords Ads from my interface.
But I have a problem to get Ad detail from id.
I try to use predicate in selector with AdGroupAd but field 'AdId' or 'Ad'
is bad and I have an error.
So I don't know how I can get an Ad by id.
This is more information :
- I use PHP package
- composer package version : "googleads/googleads-php-lib": "^27.1"
- Google version : v201705
- use Sandbox account
This is how I get ads from AdGroupId :
$adGroupAdService = $this->getGoogleService($session, AdGroupAdService::class);
$predicate = new Predicate('AdGroupId', PredicateOperator::IN,
['39244037650']);// TODO dynamic
$adGroupAds = $this->getGoogleData($adGroupAdService,
$this->getGoogleField('ad'), [], [$predicate]);
foreach ($adGroupAds as $adGroupAd){
var_dump($adGroupAd->getAd());
}
It works but it's the best way ? There are not other solution ?
And this is how I try to get an Ad by Id :
$adGroupAdService = $this->getGoogleService($session, AdGroupAdService::class);
//$predicate = new Predicate('Ad', PredicateOperator::IN, ['203114498124']);//
TODO dynamic
$predicate = new Predicate('AdId', PredicateOperator::IN, ['203114498124']);//
TODO dynamic
$adGroupAds = $this->getGoogleData($adGroupAdService,
$this->getGoogleField('ad'), [], [$predicate]);
foreach ($adGroupAds as $adGroupAd){
var_dump($adGroupAd->getAd());
}
There are no AdService class, so I try to use predicate and
AdGroupAdService to load Ad by id but fields 'AdId' and 'Ad' don't works.
This is error : [SelectorError.INVALID_PREDICATE_FIELD_NAME @
serviceSelector; trigger:'AdId']
I understand fields 'AdId' and 'Ad' are unavailable with AdGroupAd but how
I can do to load Ad by Id properly ?
Other information : I have no problem to load report by Ad
If you need more information tell me :)
Thanks
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/f643bb66-0f17-43ec-b6b8-1b9ec798a3aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.