Question about DFP reporting API

156 views
Skip to first unread message

george...@scmp.com

unread,
Apr 11, 2019, 4:39:18 AM4/11/19
to Google Ad Manager API Forum

Here is my code to generate report query.


import tempfile

from googleads import ad_manager

from googleads import errors

ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()

line_item_service = ad_manager_client.GetService('LineItemService', version='v201902')

report_downloader = ad_manager_client.GetDataDownloader(version='v201902')

statement = ad_manager.StatementBuilder(version='v201902').Where(

        'AD_UNIT_ID IN (17506807,17997607,18325687,18328207,6481663687,20401986247,20439743287,21735512136,21773646317)')

statement.limit = None

statement.offset = None

report_job = {

      'reportQuery': {

          'dimensions': ['DATE','AD_UNIT_NAME','ADVERTISER_NAME','LINE_ITEM_NAME','LINE_ITEM_TYPE','ORDER_NAME',

                         'MASTER_COMPANION_CREATIVE_NAME','COUNTRY_NAME','DEVICE_CATEGORY_NAME',

                         'PROGRAMMATIC_CHANNEL_NAME','REQUESTED_AD_SIZES'],

          'dimensionAttributes': ['ORDER_PO_NUMBER','MASTER_COMPANION_TYPE'],

          'statement': statement.ToStatement(),

          'columns': ['TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS','SDK_MEDIATION_CREATIVE_IMPRESSIONS','SDK_MEDIATION_CREATIVE_CLICKS',

                      'TOTAL_CODE_SERVED_COUNT','TOTAL_LINE_ITEM_LEVEL_CLICKS','TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE',

                      'TOTAL_LINE_ITEM_LEVEL_WITHOUT_CPD_AVERAGE_ECPM','TOTAL_LINE_ITEM_LEVEL_CTR','AD_SERVER_IMPRESSIONS',

                      'AD_SERVER_CLICKS','AD_SERVER_CPM_AND_CPC_REVENUE','AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS',

                      'AD_EXCHANGE_LINE_ITEM_LEVEL_CLICKS','AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE','AD_EXCHANGE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS',

                      'AD_EXCHANGE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS'],

          'adUnitView':'HIERARCHICAL',

          'customFieldIds':[7927,7687],

          'dateRangeType': 'CUSTOM_DATE',

          'startDate':{'year': 2019,

                       'month': 3,

                       'day': 1},

          'endDate':{'year': 2019,

                       'month': 3,

                       'day': 1}

      }

  }

report_job_id = report_downloader.WaitForReport(report_job)


  1. I have already set adUnitView to ‘HIERARCHICAL’. The report only contains dimensions Ad unit 1 and Ad unit 2, but we need dimension  Ad unit 1 up to Ad unit 5 to identify our ad unit. Please advise a solution to do that.
  2. I would like to add one more customFieldIds 10687. After adding 10687 into customFieldIds, report message occurs ‘GoogleAdsServerFault: [ReportError.ATTRIBUTES_NOT_SUPPORTED_FOR_REQUEST @ attributes; trigger:'CF[10687]_OptionID, CF[10687]_Value’]’. Please suggest a solution to add this customer fields in the query.
  3. Are we able to do filtering on custom Field by id in the statement? eg. where customFieldIds[10687] in ('xxxx').
Thanks in advance.
George

admanagerapi...@google.com

unread,
Apr 11, 2019, 3:56:25 PM4/11/19
to google-doubleclick...@googlegroups.com
Hello,

Can you please provide your network code and the user/email address making the API call via reply privately to author?

Thanks,
Sravani Yelamarthi, Ad Manager API Team
______________________________________________________________________
 An important reminder: v201805 has been deprecated.

 Give us your feedback:
     Feedback Survey

 Also find us on our blog and discussion group:
     http://googleadsdeveloper.blogspot.com/search/label/ad_manager_api
     https://developers.google.com/ad-manager/api/community

--
You received this message because you are subscribed to the Google Groups "Google Ad Manager API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-doubleclick-for-publishers-api+unsubscribe@googlegroups.com.
To post to this group, send email to google-doubleclick-for-publishers-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-doubleclick-for-publishers-api.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages