Hello Guys,
We are doing time of day bid adjustment using php adwords For that we need
need to remove the existing AdSchedule first, then add the new ones. This
is our code that we use to retrive the existing AdSchedules in our adwords
acoount. But unfortunately we are not getting any result (0 result). Please
suggest.
$campaignCriterionService = $adWordsServices->get($session,
CampaignCriterionService::class);
// Create a selector to select all campaign criteria for the
specified
// campaign.
$selector = new Selector();
$selector->setFields(['Id', 'CriteriaType',
'CampaignCriterionStatus']);
$selector->setPredicates(
[
new Predicate('CampaignId', PredicateOperator::IN,
[$campaignId]),
new Predicate(
'CriteriaType',
PredicateOperator::IN,
[
'AD_SCHEDULE'
]
)
]
);
$selector->setPaging(new Paging(0, self::PAGE_LIMIT));
$totalNumEntries = 0;
$resultCampaignCriterion = [];
do {
// Retrieve campaign criteria one page at a time, continuing to
request
// pages until all campaign criteria have been retrieved.
$page = $campaignCriterionService->get($selector);
// Print out some information for each campaign criterion.
if ($page->getEntries() !== null) {
$totalNumEntries = $page->getTotalNumEntries();
foreach ($page->getEntries() as $campaignCriterion) {
printf(
"Campaign targeting criterion with ID %d and type
'%s' was found.\n",
$campaignCriterion->getCriterion()->getId(),
$campaignCriterion->getCriterion()->getType()
);
}
}
$selector->getPaging()->setStartIndex(
$selector->getPaging()->getStartIndex() + self::PAGE_LIMIT
);
} while ($selector->getPaging()->getStartIndex() <
$totalNumEntries);
//return $resultCampaignCriterion;
printf("Number of results found: %d\n", $totalNumEntries);
Thank you in advance for your cooperation.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/c6e9fec1-4aad-4630-aaa3-f8dd085f1b3bo%40googlegroups.com.