custom Dimension through API

501 views
Skip to first unread message

sankar natarajan

unread,
Dec 10, 2021, 8:31:13 AM12/10/21
to Google Ad Manager API Forum
Hi,

I am trying to extract the custom dimension through API. I don't know how to provide the report query. I have seen this link which states not possible. Is that solved right now? or any other way to get the key-value data?


Sankar

Ad Manager API Forum Advisor

unread,
Dec 12, 2021, 11:24:09 PM12/12/21
to tnsan...@gmail.com, google-doubleclick...@googlegroups.com

Hi Sankar,

 

Thanks for reaching out to us.

 

You may use this for reporting, by including CUSTOM_DIMENSION in your dimensions and setting customDimensionKeyIds in your reportQuery when building your report.

 

However, if you would like to retrieve all the key-value data from your network, you may use the methods getCustomTargetingKeysByStatement and getCustomTargetingValuesByStatement from the CustomTargetingService respectively. You may refer to this link for the former and this link for the latter to check out our example code in Java.

 

Furthermore, here's a link to all the available client libraries we currently support so you may browse our example code from different client libraries on the methods. Let me know if you would have any further clarifications.

 

Regards,

 

Google Logo
Yasmin Gabrielle Padua
Ad Manager API Team
 


ref:_00D1U1174p._5004Q2Sduvj:ref
Message has been deleted

Ad Manager API Forum Advisor

unread,
Dec 13, 2021, 4:28:58 AM12/13/21
to tnsan...@gmail.com, google-doubleclick...@googlegroups.com

Hi Sankar,

 

I'll have to redact your message and include a masked version of it as it contains sensitive information.

 

I believe it's the correct methods to retrieve custom targeting keys and values, as per your first inquiry. That being said, can I request for the following information so that I may further investigate this? Kindly send them via Reply privately to author option:

  • Network code
  • Complete SOAP request and response logs (SOAP logging must be enabled)
  • Complete SOAP request and response logs of getCurrentUser()

 

Thanks,

 

Google Logo
Yasmin Gabrielle Padua
Ad Manager API Team
 

 

 

---

 

Hi Yasmin,

 

Thanks for your reply. I have tried the that you requested. But few errors with the build report query statement. The below is the query I have tried and it returned the error 

"Exception has occurred: GoogleAdsServerFault

[ReportError.INVALID_CUSTOM_CRITERIA_DIMENSION @ ; trigger:'TOP_LEVEL_CUSTOM_TARGETING_KEY[]_VALUE']

 

I couldn't make sense of this statement:

"The list of custom dimension custom targeting key IDs being requested in this report. This will include dimensions in the form of TOP_LEVEL_DIMENSION_KEY[id]_ID and TOP_LEVEL_DIMENSION_KEY[id]_VALUE where ID is the ID of the custom targeting value and VALUE is the name."

 

I have tried "get_all_custom_targeting_keys_and_values.py" to get the customtarget key and values by the statement as provided in the link: https://github.com/googleads/googleads-python-lib/tree/master/examples/ad_manager/v202111/custom_targeting_service

 

I hope that link is the correct location to get a custom target service. But I did not see the attached custom dimension. Or maybe I am wrong with the query.

 

1. If the below query formation is wrong, what is the correct method.

2. If I am wrong with custom target service, How do I get methods getCustomTargetingKeysByStatement and getCustomTargetingValuesByStatement from the CustomTargetingService

 

I did not see examples to get the details on your documentation site. So we are struggling with that as new to the Ad manager. Can you please help, how to do that? since this issue drag us long time and would like close ASAP.

 

 

 

The query :

 

report_job = {

      'reportQuery': {

        'dimensions': ['DATE','COUNTRY_CRITERIA_ID','COUNTRY_NAME','LINE_ITEM_NAME','CONTENT_NAME','CUSTOM_DIMENSION'],

        'columns': ['TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS','VIDEO_VIEWERSHIP_FIRST_QUARTILE','VIDEO_VIEWERSHIP_START','VIDEO_VIEWERSHIP_MIDPOINT','VIDEO_VIEWERSHIP_THIRD_QUARTILE','VIDEO_VIEWERSHIP_COMPLETE'],

        'dimensionAttributes': [ 'CONTENT_CMS_VIDEO_ID','LINE_ITEM_COST_PER_UNIT'],              

        'customFieldIds': ,

        'customDimensionKeyIds' : [],

        'dateRangeType': 'CUSTOM_DATE',

        'startDate': {

          'year': 2021,

          'month': start_date.strftime("%m"),

          'day': start_date.strftime("%d")

        },

        'endDate': {

          'year': 2021,

          'month': start_date.strftime("%m"),

          'day': start_date.strftime("%d")

        },

      

      }

    }



ref:_00D1U1174p._5004Q2Sduvj:ref

Ad Manager API Forum Advisor

unread,
Dec 14, 2021, 2:54:52 AM12/14/21
to tnsan...@gmail.com, google-doubleclick...@googlegroups.com

Hi Sankar,

 

I've sent out a response to your private email.

 

If you're having trouble receiving private replies from us, please check your Spam folder. Additionally, please add the 'From address' on that email to your contact list to ensure we aren't flagged as Spam in future messages. If you don't see a message from us in your Spam folder, please email us directly at admanagera...@google.com referring to your forum post "custom Dimension through API".

 

Thanks,

 

Google Logo
Yasmin Gabrielle Padua
Ad Manager API Team
 


ref:_00D1U1174p._5004Q2Sduvj:ref
Reply all
Reply to author
Forward
0 new messages