How to get Unified pricing rule from Google Ad Manager API?

282 views
Skip to first unread message

Eva Wong

unread,
Aug 7, 2020, 5:35:06 AM8/7/20
to Google Ad Manager API Forum
Hi all,

May I know how can i get this value from API.
I can get it in historical report but i cannot find the same field in the columns.

Thanks.

Eva

Ad Manager API Forum Advisor Prod

unread,
Aug 9, 2020, 11:08:48 PM8/9/20
to evawon...@gmail.com, google-doubleclick...@googlegroups.com

Hi Eva,

 

Can you please elaborate your concern so I can better understand this and further investigate? Please provide your network code and a sample data that you wish to retrieve via ReportService. You can send these to me via Reply privately to author option.

 

Thanks,

Kevin Soriano, Ad Manager API Team



ref:_00D1U1174p._5004Q23INo8:ref

Eva Wong

unread,
Aug 9, 2020, 11:20:07 PM8/9/20
to Google Ad Manager API Forum
Hi Kevin,

I would like to generate the unified pricing rule (which can get in Google Ad Manager UI - Historical Report).
However, i can only find AD_EXCHANGE_PRICING_RULE_ID and AD_EXCHANGE_PRICING_RULE_NAME in enum Dimension (v202005) and both give error code.

Network Code: 183518426
Code: 
report_job = {
        'reportQuery': {
        'adUnitView': 'TOP_LEVEL',
        'dimensions':['DATE','HOUR','AD_UNIT_NAME', 'AD_EXCHANGE_PRICING_RULE_ID'],
        'columns':['ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS','ADSENSE_LINE_ITEM_LEVEL_REVENUE',
                   'AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS','AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE'],
        'dateRangeType': 'CUSTOM_DATE',
        'startDate': start_date,
        'endDate': end_date
        }
    }
Error Code: Traceback (most recent call last):
  File "C:\Users\Va\Desktop\Dashboard\PricingRule.py", line 93, in <module>
    main()
  File "C:\Users\Va\Desktop\Dashboard\PricingRule.py", line 74, in main
    report_job_id = report_downloader.WaitForReport(report_job)
  File "C:\Users\Va\AppData\Local\Programs\Python\Python38\lib\site-packages\googleads\ad_manager.py", line 779, in WaitForReport
    report_job_id = service.runReportJob(report_job)['id']
  File "C:\Users\Va\AppData\Local\Programs\Python\Python38\lib\site-packages\googleads\common.py", line 1003, in MakeSoapRequest
    raise googleads.errors.GoogleAdsServerFault(
googleads.errors.GoogleAdsServerFault: [ReportError.COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS @ columns; trigger:'ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS, ADSENSE_LINE_ITEM_LEVEL_REVENUE, AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS, AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE']

What i want to have:
Unified pricing rule
(No pricing rule applied)
HKET & ULifestyle Network

Best Regards,
Eva Wong

Ad Manager API Forum Advisor Prod

unread,
Aug 10, 2020, 4:13:01 AM8/10/20
to evawon...@gmail.com, google-doubleclick...@googlegroups.com

Hi Eva,

 

Thank you for clarifying your concern. Upon checking, you will have to remove either the HOUR or the AD_EXCHANGE_PRICING_RULE_ID dimension as all 4 of your metrics cannot be included when both the dimensions are used in a single report. You may simply generate 2 reports to pull information for both dimensions.

 

Let me know if you have further clarification.

Eva Wong

unread,
Aug 10, 2020, 5:35:33 AM8/10/20
to Ad Manager API Forum Advisor Prod, google-doubleclick...@googlegroups.com
Hi Kevin,

I try to remove HOUR,  it is still not working. How can i extract the unified pricing rule?

)
 


    ################## Fetching key-value report #####################
    # State report job query - Key Value
    report_job_key = {
        'reportQuery': {
        'adUnitView': 'TOP_LEVEL',
        'dimensions':['DATE','AD_UNIT_NAME','AD_EXCHANGE_PRICING_RULE_ID'],

        'columns':['ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS','ADSENSE_LINE_ITEM_LEVEL_REVENUE',
                   'AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS','AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE'],
        'dateRangeType': 'CUSTOM_DATE',
        'startDate': start_date,
        'endDate': end_date
        }
    }


raise googleads.errors.GoogleAdsServerFault(
googleads.errors.GoogleAdsServerFault: [ReportError.COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS @ columns; trigger:'ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS, ADSENSE_LINE_ITEM_LEVEL_REVENUE, AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS, AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE']

Ad Manager API Forum Advisor Prod

unread,
Aug 10, 2020, 9:07:32 PM8/10/20
to evawon...@gmail.com, google-doubleclick...@googlegroups.com

Hi Eva,

 

Thank you for sharing more information. I'll discuss this further with the rest of our team for further analysis. We'll reach out to you as soon as we have more information.

Ad Manager API Forum Advisor Prod

unread,
Aug 11, 2020, 10:02:15 AM8/11/20
to evawon...@gmail.com, google-doubleclick...@googlegroups.com
Hi Eva,

The 'Unified pricing rule' dimension you see in the UI is not currently supported in the Ad Manager API. The dimension you're trying to use equivalent to 'Pricing rule' for Ad Exchange Historical reports.

I'll pass this feedback along to the engineering reporting team.
 
Google Logo
Chris Seeley
Ad Manager API Team
Share your feedback
 


 

ref:_00D1U1174p._5004Q23INo8:ref

evawon...@gmail.com

unread,
Aug 18, 2020, 12:38:33 AM8/18/20
to Google Ad Manager API Forum
Hi Chris,

Any updates why i cannot use the below to get to pricing rule id? I would like to get the pricing rule id and match with the rule name later.
Or any dimension that i can match correctly with ad exchange historical report from historical report. 

    ################## Fetching key-value report #####################
    # State report job query - Key Value
    report_job_historial = {
        'reportQuery': {
        'dimensions':['DATE', 'AD_UNIT_NAME', 'AD_EXCHANGE_PRICING_RULE_ID'],
        'columns':['ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS','ADSENSE_LINE_ITEM_LEVEL_REVENUE',
                   'AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS','AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE'],
        'dateRangeType': 'CUSTOM_DATE',
        'startDate': start_date,
        'endDate': end_date
        }
    }


googleads.errors.GoogleAdsServerFault: [ReportError.COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS @ columns; trigger:'ADSENSE_LINE_ITEM_LEVEL_IMPRESSIONS, ADSENSE_LINE_ITEM_LEVEL_REVENUE, AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS, AD_EXCHANGE_LINE_ITEM_LEVEL_REVENUE']





Ad Manager API Forum Advisor Prod

unread,
Aug 21, 2020, 3:53:06 PM8/21/20
to google-doubleclick...@googlegroups.com
Hi Eva,

You can retrieve the AD_EXCHANGE_PRICING_RULE_ID column in an Ad Exchange report, example XML as follows:

<reportQuery>
  <dimensions>AD_EXCHANGE_PRICING_RULE_ID</dimensions>
  <dimensions>AD_EXCHANGE_PRICING_RULE_NAME</dimensions>
  <adUnitView>TOP_LEVEL</adUnitView>
  <columns>AD_EXCHANGE_IMPRESSIONS</columns>
  <dateRangeType>YESTERDAY</dateRangeType>
  <timeZoneType>AD_EXCHANGE</timeZoneType>
</reportQuery>


Note that this is not the same as the Unified Pricing Rule ID you see in the Ad Manager UI, it's the Ad Exchange ID for the pricing rule. Also note that reporting only returns rows for non-zero values. So if a rule has no impressions for your date range, it won't be included in this list.
Reply all
Reply to author
Forward
0 new messages