Request for Assistance: Google Ad Manager API Errors

43 views
Skip to first unread message

Siobhan Doherty

unread,
May 13, 2024, 4:56:52 AMMay 13
to Google Ad Manager API Forum

Dear Google Ad Manager API Team,

I am writing to seek assistance in regards to errors encountered while using the Google Ad Manager API. Despite extensive review of the API documentation, as well as examining open and closed issues on the official GitHub repository related to my concerns, I could not find documentation to resolve the API integration challenge I am faced with. Could you please provide guidance on resolving these issues? Any insights or recommendations on how to correctly structure the API requests or handle these specific errors would be greatly appreciated.

Here are the specific errors I am encountering:

  1. Unmarshalling Error: cvc-datatype-valid.1.2.1: '2024-03-10' is not a valid value for 'integer'.
  2. KeyError: 'requestQuery'
  3. KeyError: 'filterCondition'

These errors occur when attempting to run reports for different types such as adx, dfp, inventory, and preferred-deal, with the specified start and end dates.

I have provided examples of the error messages below for your reference:

 -               python GamImportCommand.py --start 2024-03-10 --end 2024-03-11 --type adx Report Query:  {'requestQuery': {'dateRangeType': '', 'startDate': '2024-03-10', 'endDate': '2024-03-11', 'adUnitView': 'FLAT', 'columns': ['AD_EXCHANGE_TOTAL_REQUESTS', 'AD_EXCHANGE_RESPONSES_SERVED', 'AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS', 'AD_EXCHANGE_LINE_ITEM_LEVEL_CLICKS', 'AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE'], 'dimensions': ['DATE', 'AD_UNIT_ID', 'PROGRAMMATIC_CHANNEL_NAME', 'IS_FIRST_LOOK_DEAL', 'PROGRAMMATIC_DEAL_ID', 'PROGRAMMATIC_DEAL_NAME', 'BUYER_NETWORK_ID', 'BUYER_NETWORK_NAME']}}Traceback (most recent call last):  File "GamImportCommand.py", line 63, in <module>    runPipeline()  File "GamImportCommand.py", line 51, in runPipeline    reportFile = GamImporter().downloadReport(ReportFactory().createReportFilter(args.report_type), args.start, args.end)  File "/Users/siobhandoherty/Desktop/data-engineering-study/data-github/yoc-data-products/importers/gam/service/GamImporter.py", line 20, in downloadReport    reportId = downloader.WaitForReport(reportQuery)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/ad_manager.py", line 899, in WaitForReport    report_job_id = service.runReportJob(report_job)['id']  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 981, in MakeSoapRequest    packed_args = self._PackArguments(method_name, args)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 842, in _PackArguments    result = [self._PackArgumentsHelper(param, param_data, set_type_attrs)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 842, in <listcomp>    result = [self._PackArgumentsHelper(param, param_data, set_type_attrs)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 887, in _PackArgumentsHelper    packed_result = self._CreateComplexTypeFromData(  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 949, in _CreateComplexTypeFromData    instantiated_arguments = {  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 950, in <dictcomp>    k: self._PackArgumentsHelper(elem_arguments[k], v, set_type_attrs)KeyError: 'requestQuery' 
-               python GamImportCommand.py --start 2024-03-10 --end 2024-03-11 --type dfpReport Query:  {'reportQuery': {'dateRangeType': 'CUSTOM_DATE', 'startDate': '2024-03-10', 'endDate': '2024-03-11', 'adUnitView': 'FLAT', 'dimensions': ['DATE', 'ORDER_ID', 'LINE_ITEM_ID', 'LINE_ITEM_TYPE', 'CREATIVE_ID', 'CREATIVE_TYPE', 'AD_UNIT_ID'], 'columns': ['AD_SERVER_IMPRESSIONS', 'AD_SERVER_UNFILTERED_IMPRESSIONS', 'AD_SERVER_CLICKS', 'AD_SERVER_CTR', 'AD_SERVER_CPM_AND_CPC_REVENUE', 'AD_SERVER_CPD_REVENUE', 'AD_SERVER_ALL_REVENUE', 'TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS', 'TOTAL_LINE_ITEM_LEVEL_CLICKS', 'TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE', 'TOTAL_LINE_ITEM_LEVEL_ALL_REVENUE'], 'filterCondition': 'LINE_ITEM_TYPE != :type', 'filterBindings': [{'type': 'PREFERRED_DEAL'}]}}Traceback (most recent call last):  File "GamImportCommand.py", line 63, in <module>    runPipeline()  File "GamImportCommand.py", line 51, in runPipeline    reportFile = GamImporter().downloadReport(ReportFactory().createReportFilter(args.report_type), args.start, args.end)  File "/Users/siobhandoherty/Desktop/data-engineering-study/data-github/yoc-data-products/importers/gam/service/GamImporter.py", line 20, in downloadReport    reportId = downloader.WaitForReport(reportQuery)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/ad_manager.py", line 899, in WaitForReport    report_job_id = service.runReportJob(report_job)['id']  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 981, in MakeSoapRequest    packed_args = self._PackArguments(method_name, args)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 842, in _PackArguments    result = [self._PackArgumentsHelper(param, param_data, set_type_attrs)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 842, in <listcomp>    result = [self._PackArgumentsHelper(param, param_data, set_type_attrs)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 887, in _PackArgumentsHelper    packed_result = self._CreateComplexTypeFromData(  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 949, in _CreateComplexTypeFromData    instantiated_arguments = {  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 950, in <dictcomp>    k: self._PackArgumentsHelper(elem_arguments[k], v, set_type_attrs)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 887, in _PackArgumentsHelper    packed_result = self._CreateComplexTypeFromData(  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 949, in _CreateComplexTypeFromData    instantiated_arguments = {  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 950, in <dictcomp>    k: self._PackArgumentsHelper(elem_arguments[k], v, set_type_attrs)KeyError: 'filterCondition' 
-               python GamImportCommand.py --start 2024-03-10 --end 2024-03-11 --type preferred-dealReport Query:  {'reportQuery': {'dateRangeType': 'CUSTOM_DATE', 'startDate': '2024-03-10', 'endDate': '2024-03-11', 'adUnitView': 'FLAT', 'dimensions': ['DATE', 'AD_UNIT_ID', 'LINE_ITEM_TYPE', 'LINE_ITEM_ID', 'LINE_ITEM_NAME'], 'columns': ['AD_SERVER_IMPRESSIONS', 'AD_SERVER_CLICKS', 'AD_SERVER_ALL_REVENUE'], 'filterCondition': 'LINE_ITEM_TYPE != :type', 'filterBindings': [{'type': 'PREFERRED_DEAL'}]}}Traceback (most recent call last):  File "GamImportCommand.py", line 63, in <module>    runPipeline()  File "GamImportCommand.py", line 51, in runPipeline    reportFile = GamImporter().downloadReport(ReportFactory().createReportFilter(args.report_type), args.start, args.end)  File "/Users/siobhandoherty/Desktop/data-engineering-study/data-github/yoc-data-products/importers/gam/service/GamImporter.py", line 20, in downloadReport    reportId = downloader.WaitForReport(reportQuery)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/ad_manager.py", line 899, in WaitForReport    report_job_id = service.runReportJob(report_job)['id']  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 981, in MakeSoapRequest    packed_args = self._PackArguments(method_name, args)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 842, in _PackArguments    result = [self._PackArgumentsHelper(param, param_data, set_type_attrs)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 842, in <listcomp>    result = [self._PackArgumentsHelper(param, param_data, set_type_attrs)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 887, in _PackArgumentsHelper    packed_result = self._CreateComplexTypeFromData(  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 949, in _CreateComplexTypeFromData    instantiated_arguments = {  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 950, in <dictcomp>    k: self._PackArgumentsHelper(elem_arguments[k], v, set_type_attrs)  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 887, in _PackArgumentsHelper    packed_result = self._CreateComplexTypeFromData(  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 949, in _CreateComplexTypeFromData    instantiated_arguments = {  File "/opt/anaconda3/envs/sio/lib/python3.8/site-packages/googleads/common.py", line 950, in <dictcomp>    k: self._PackArgumentsHelper(elem_arguments[k], v, set_type_attrs)KeyError: 'filterCondition'

Thank you, I look forward to your response and assistance.

Best regards,

Siobhan Doherty

Ad Manager API Forum Advisor

unread,
May 14, 2024, 2:59:04 AMMay 14
to siobhan...@yoc.com, google-doubleclick...@googlegroups.com
Hi,

Thank you for contacting the Ad Manager API support team.

I have reviewed your query and understand that you are facing an error while running the report. I would like to inform you that these are available data ranges in the ReportService. I can confirm that the custom date range of the last 1 day feature is not available in the API. I will raise a request to add this feature to the API. I cannot provide a scheduled timeline for availability of this feature to the API. You may follow our release notes and blog post for future updates. I recommended using fixed date range instead of custom date range. If still the issue persists,Please provide us with the following details to investigate the issue further.        You can send the details via Reply privately to the author option, or direct private reply to this email.


 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tIx82:ref" (ADR-00234701)

Thanks,
 
Google Logo Ad Manager API Team

 

Reply all
Reply to author
Forward
0 new messages