Issue with API Call: Need Assistance Resolving Unexpected Errors when use AudienceInsightsService

31 views
Skip to first unread message

Jing CHEN

unread,
Jun 13, 2024, 12:39:01 PM6/13/24
to Google Ads API and AdWords API Forum
I encountered a strange situation when using the API. In the following call, 

```
client = mccid_client[mcc_id]
ga_service = client.get_service("AudienceInsightsService")
affinity_user_interest_enum = (
    client.enums.AudienceInsightsDimensionEnum.AFFINITY_USER_INTEREST
)
in_market_user_interest_enum = (
    client.enums.AudienceInsightsDimensionEnum.IN_MARKET_USER_INTEREST
)
response = ga_service.list_audience_insights_attributes(
    customer_id=str(cid),
    dimensions=[affinity_user_interest_enum, in_market_user_interest_enum],
    query_text="credit",
    customer_insights_group="credit",
)


when I did not include 'customer_insights_group', the call threw an error: 
```
google.ads.googleads.errors.GoogleAdsException: (<_InactiveRpcError of RPC that terminated with: status = StatusCode.INVALID_ARGUMENT details = "Request contains an invalid argument." debug_error_string = "UNKNOWN:Error received from peer xxxx {created_time:"2024-06-13T10:51:57.7495433+00:00", grpc_status:3, grpc_message:"Request contains an invalid argument."}" >, <_InactiveRpcError of RPC that terminated with: status = StatusCode.INVALID_ARGUMENT details = "Request contains an invalid argument." debug_error_string = "UNKNOWN:Error received from peer xxxx {created_time:"2024-06-13T10:51:57.7495433+00:00", grpc_status:3, grpc_message:"Request contains an invalid argument."}" >, errors { error_code { field_error: REQUIRED } message: "The required field was not present." location { field_path_elements { field_name: "customer_insights_group" } } } request_id: "Xc2lPi5MjkfH7xR-sGm4IA" , 'Xc2lPi5MjkfH7xR-sGm4IA') 
```
 But when I include this parameter, I encounter:
```
TypeError: AudienceInsightsServiceClient.list_audience_insights_attributes() got an unexpected keyword argument 'customer_insights_group'. 

 What should I do...
```

Google Ads API Forum Advisor

unread,
Jun 13, 2024, 5:23:50 PM6/13/24
to chenj...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

As per provided information, I understand that you are encountering the 'invalid_argument' error while making an API request. To troubleshoot your issue, kindly provide us with the complete API logs (request and response with request-id and request header) generated at your end, do note that only error logs are not sufficient to analyze the issue.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can share the requested details via Reply privately to the author option or a direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tJKFn:ref" (ADR-00240715)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


Reply all
Reply to author
Forward
0 new messages