Good day,
I am just wondering if where can I view or check the adjusted bid that I made in a placement?
I would want to view the adjustment to make sure that the changes or the code that I run thru the API was successful.
Is it on VIEW HISTORY, like the image below?
or in the Display Network? Please see the image below.
Am I doing it right?
Here is my code:
const BID_MODIFIER = '2';
public static function runExample(AdWordsServices $adWordsServices,
AdWordsSession $session, $campaignId, $bidModifier) {
campaignCriterionService =
$adWordsServices->get($session, CampaignCriterionService::class);
$urlPlacement = new Placement();
$urlPlacement->setUrl('websitehere.com');
$urlPlacement->setId(30000);
// Create a criterion with modified bid.
$criterion = new CampaignCriterion();
$criterion->setCampaignId($campaignId);
$criterion->setCriterion($urlPlacement);
$criterion->setBidModifier($bidModifier);
$operation = new CampaignCriterionOperation();
$operation->setOperator(Operator::SET);
$operation->setOperand($criterion);
$operations = [$operation];
$results = $campaignCriterionService->mutate($operations);
// Print out some information about the updated campaign criterion.
foreach ($results->getValue() as $campaignCriterion) {
printf(
"Campaign criterion with campaign ID %d, criterion ID %d, "
. "and type '%s' was modified with bid %.2f.\n",
$campaignCriterion->getCampaignId(),
$campaignCriterion->getCriterion()->getId(),
$campaignCriterion->getCriterion()->getType(),
$campaignCriterion->getBidModifier());
}
}
Thank you so much,
Ben
<soapenv:Body>
<mutate xmlns="https://adwords.google.com/api/adwords/cm/v201708">
<operations>
<operator>SET</operator>
<operand xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201708" xsi:type="ns2:BiddableAdGroupCriterion">
<ns2:adGroupId>XXXXXXXXXXX</ns2:adGroupId>
<ns2:criterion xsi:type="ns2:Placement">
<ns2:id>XXXXXXXXXXX</ns2:id>
<ns2:url>site.www.hello.com</ns2:url>
</ns2:criterion>
<ns2:bidModifier>1.5</ns2:bidModifier>
</operand>
</operations>
</mutate>
</soapenv:Body>Placement urlPlacement = new Placement();
urlPlacement.setId(XXXXXXXXXXX);
urlPlacement.setUrl("site.www.hello.com");
BiddableAdGroupCriterion adGroupCriterion = new BiddableAdGroupCriterion();
adGroupCriterion.setAdGroupId(XXXXXXXXXXX);
adGroupCriterion.setCriterion(urlPlacement);
adGroupCriterion.setBidModifier(BID_MODIFIER);
AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
operation.setOperand(adGroupCriterion);
operation.setOperator(Operator.SET);
AdGroupCriterionServiceInterface adGroupCriterionService =
adWordsServices.get(session, AdGroupCriterionServiceInterface.class);
AdGroupCriterionReturnValue result =
adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {operation});<soapenv:Body>
<get xmlns="https://adwords.google.com/api/adwords/cm/v201708">
<serviceSelector>
<fields>Id</fields>
<fields>CriteriaType</fields>
<fields>BidModifier</fields>
<fields>PlacementUrl</fields>
<predicates>
<field>CriteriaType</field>
<operator>EQUALS</operator>
<values>PLACEMENT</values>
</predicates>
<paging>
<startIndex>0</startIndex>
<numberResults>100</numberResults>
</paging>
</serviceSelector>
</get>
</soapenv:Body>public static function runExample(AdWordsServices $adWordsServices,
AdWordsSession $session, $AD_GROUP_ID, $bidModifier) {
$adGroupCriterionService =
$adWordsServices->get($session, AdGroupCriterionService::class);
//Create a mobile platform. The ID can be found in the documentation.
//https://developers.google.com/adwords/api/docs/appendix/platforms
$desktop= new Platform();
$desktop->setId(30000); // HighEndMobile = 30001
$urlPlacement = new Placement();
$urlPlacement->setUrl('listverse.com');
$urlPlacement->setId('XXXXXXXXXX');
// Create a criterion with modified bid.
$adGroup = new BiddableAdGroupCriterion();
$adGroup->setAdGroupId($AD_GROUP_ID );
$adGroup->setCriterion($urlPlacement);
$adGroup->setBidModifier($bidModifier);
// Create a campaign criterion operation and add it to the operations list.
$operation = new AdGroupCriterionOperation();
$operation->setOperator(Operator::SET);
$operation->setOperand($adGroup);
$operations = [$operation];
// Update campaign criteria on the server.
$results = $adGroupCriterionService->mutate($operations);
// Print out some information about the updated campaign criterion.
foreach ($results->getValue() as $adGroupCriterion) {
printf(
"Campaign criterion with campaign ID %d, criterion ID %d, "
. "and type '%s' was modified with bid %.2f.\n",
$adGroupCriterion->getAdGroupId(),
$adGroupCriterion->getCriterion()->getId(),
$adGroupCriterion->getCriterion()->getType(),
$adGroupCriterion->getBidModifier());
}
}