UAC Reporting Api return 400 Bad Request

208 views
Skip to first unread message

gilbertmm...@gmail.com

unread,
Jul 12, 2018, 6:35:22 AM7/12/18
to AdWords API and Google Ads API Forum
hi,i use reporting api to get UAC campaign data,but i got 400 error code.

here is my query code.
$query = (new ReportQueryBuilder())
    ->select([
        'CampaignId',
        'CampaignName',
        'Impressions',
        'Clicks',
        'AllConversions',
        'Conversions',
        'CostPerConversion',
        'Cost'
    ])
    ->from(ReportDefinitionReportType::CRITERIA_PERFORMANCE_REPORT)
    ->where('AdvertisingChannelSubType')->equalTo('UNIVERSAL_APP_CAMPAIGN')
    ->duringDateRange(ReportDefinitionDateRangeType::LAST_7_DAYS)
    ->build();

here is error message:

POST /api/adwords/reportdownload/v201802 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Authorization: REDACTED
developerToken: REDACTED
clientCustomerId:XXXXXXXX
User-Agent: unknown (AwApi-PHP, googleads-php-lib/35.1.0, PHP/7.1.17, GuzzleHttp/6.3.3, curl/7.53.1, ReportQueryBuilder)
skipReportHeader: false


skipColumnHeader: false


skipReportSummary: false
useRawEnumValues: false
includeZeroImpressions: false

__rdquery=SELECT CampaignId, Impressions, Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT WHERE AdvertisingChannelSubType = 'UNIVERSAL_APP_CAMPAIGN' DURING LAST_7_DAYS&__fmt=CSV

Response:
REDACTED REPORT DATA
--------
Error:
Client error: `POST https://adwords.google.com/api/adwords/reportdownload/v201802` resulted in a `400 Bad Request` response

PHP Fatal error:  Uncaught Google\AdsApi\AdWords\v201802\cm\ApiException: Details: [fieldPath: AdvertisingChannelSubType; trigger: Invalid predicate name: AdvertisingChannelSubType; errorString: SelectorError.INVALID_PREDICATE_FIELD_NAME] in /googleads/googleads-php-lib/src/Google/AdsApi/AdWords/Reporting/v201802/ReportDownloader.php:234

I take the guide code to use the field 'AdvertisingChannelSubType' to filter UAC campaign,but i not working.

how can i fix this?


Dhanya Sundararaju (AdWords API Team)

unread,
Jul 12, 2018, 2:56:07 PM7/12/18
to AdWords API and Google Ads API Forum
Hi,

UAC Campaigns are not supported via the Criteria Performance Report. For the fields you have selected, you can run the Campaign Performance Report. That is:

SELECT CampaignId, Impressions, Clicks, Cost FROM CAMPAIGN_PERFORMANCE_REPORT WHERE AdvertisingChannelSubType = UNIVERSAL_APP_CAMPAIGN DURING LAST_7_DAYS 

Other reports you can run for UAC Campaigns, are as mentioned in this section of the guide. Please let me know if you have any further questions.

Regards,
Dhanya, AdWords API Team
Reply all
Reply to author
Forward
0 new messages