Hello,
$query = "SELECT
campaign.id,
campaign.name,
campaign.status,
campaign.campaign_budget
FROM
campaign";
$response = $googleAdsServiceClient->search($customerId, $query,
['pageSize' => PAGE_SIZE_2]);
in file.log I get the value of campaignBudget
[2019-04-26 08:13:11] google-ads.DEBUG: Request made: Host:
"googleads.googleapis.com", Method:
"/google.ads.googleads.v1.services.GoogleAdsService/Search",
ClientCustomerId: 5508690386, RequestId: "PSA1r5BtQK4FxfIyRVpeJA", IsFault:
0, FaultMessage: "None"
[2019-04-26 08:13:11] google-ads.DEBUG: Request
-------
Method Name: /google.ads.googleads.v1.services.GoogleAdsService/Search
Host: googleads.googleapis.com
Headers: {
"x-goog-api-client": "gl-php\/7.2.15-0ubuntu0.18.04.2 gapic\/
gax\/0.38.0 grpc\/1.19.0",
"developer-token": "REDACTED",
"login-customer-id": "9482115893"
}
Request:
{"customerId":"5508690386","query":"SELECT\r\n\t\t\t\t\t\tbidding_strategy.type,\r\n\t\t\t\t\t\tcampaign.end_date,\r\n\t\t\t\t\t\tcampaign.id,\r\n\t\t\t\t\t\tcampaign.payment_mode,\r\n\t\t\t\t\t\tcampaign.name,\r\n\t\t\t\t\t\tcampaign.status,\r\n\t\t\t\t\t\tcampaign.campaign_budget\r\n\t\t\t\tFROM\r\n\t\t\t\t\tcampaign
WHERE campaign.status != 'REMOVED' ORDER BY campaign.id
DESC","pageSize":1000}
Response
-------
Headers: {
"content-disposition": "attachment",
"request-id": "PSA1r5BtQK4FxfIyRVpeJA",
"date": "Fri, 26 Apr 2019 08:13:11 GMT",
"alt-svc": "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""
}
Response:
{"results":[{"campaign":{"resourceName":"customers\/5508690386\/campaigns\/224533906","id":"224533906","name":"Ukr","status":"ENABLED","campaignBudget":"customers\/5508690386\/campaignBudgets\/49577746","endDate":"2037-12-30"}}],"totalResultsCount":"1","fieldMask":"biddingStrategy.type,campaign.endDate,campaign.id,campaign.paymentMode,campaign.name,campaign.status,campaign.campaignBudget"}
and trying to get this value in php so:
foreach ($response->iterateAllElements() as $googleAdsRow) {
echo $googleAdsRow->getCampaignBudget();
}
but $ googleAdsRow-> getCampaignBudget () returns null.
Question: how to get the ResourceName budget, then get the amount_micros ?
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
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/d4de310b-c476-49da-968c-77e457206850%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.