Problem with get Assets

268 views
Skip to first unread message

Денис Грязев

unread,
Nov 17, 2021, 8:33:20 AM11/17/21
to AdWords API and Google Ads API Forum
Can't get group-bound extensions. I make a request SELECT asset.idad_group.id FROM ad_group_asset WHERE ad_group.id = 134163680852, in response, I do not receive the extensions that I tied to the group.

Google Ads API Forum Advisor

unread,
Nov 17, 2021, 5:02:42 PM11/17/21
to smeta...@gmail.com, adwor...@googlegroups.com
Hi Денис,

Could you privately send us a request and response log of API communication that returns nothing combined with a screenshot of the assets attached at ad group level? 

The request and response appears similar to the JSON Mappings in our REST documentation. Our client libraries have loggers with logging instructions, to see these instructions you can click on the client library you use in the sidebar of our client library guide and click on "Logging". Setting the logger to 'DEBUG' will get the desired log.

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey

Regards,
 
Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2R9nyj:ref

Денис Грязев

unread,
Nov 23, 2021, 7:06:58 AM11/23/21
to AdWords API and Google Ads API Forum
Hi,
Debug info

[2021-11-23T15:03:12.710891+03:00] google-ads.NOTICE: Request
-------
Method Name: /google.ads.googleads.v9.services.GoogleAdsService/SearchStream
Host: googleads.googleapis.com
Headers: {
"x-goog-api-client": "gl-php\/7.4.3 gccl\/12.1.0 gapic\/12.1.0 gax\/1.10.0 grpc\/1.41.0 rest\/1.10.0",
"x-goog-request-params": "customer_id=2472654488",
"developer-token": "REDACTED",
"login-customer-id": "2888919473"
}
Request:
{"customerId":"2472654488","query":"SELECT ad_group_asset.ad_group, ad_group_asset.asset FROM ad_group_asset WHERE ad_group_asset.ad_group IN (15059727331)"}

Response
-------
Headers: {
"request-id": "6CO91twBe1oB4igwFMBdZA",
"date": "Tue, 23 Nov 2021 12:03:10 GMT",
"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
}

Fault
-------
Status code: 3
Details: Request contains an invalid argument.
Failure: {"errors":[{"errorCode":{"requestError":"RESOURCE_NAME_MALFORMED"},"message":"Resource name '15059727331' is malformed: expected 'customers\/{customer_id}\/adGroups\/{ad_group_id}'."}],"requestId":"6CO91twBe1oB4igwFMBdZA"}  

My code

$fields = [
'ad_group_asset.ad_group',
'ad_group_asset.asset',
];

$where[] = 'ad_group_asset.ad_group IN (' . join(',', $cIds) . ')';

$elements = $client->getAllElements($customerId, 'ad_group_asset', $fields, $where);

foreach ($elements as $element) {
$asset = $element->getAsset();
}

четверг, 18 ноября 2021 г. в 01:02:42 UTC+3, adsapi:

Google Ads API Forum Advisor

unread,
Nov 23, 2021, 4:56:29 PM11/23/21
to adwor...@googlegroups.com, smeta...@gmail.com
Hi Денис,

I responded to you on November 22, unfortunately you didn't receive my response so here's a redacted copy:

Hi,

Thank you for sending us privately your log. You are using a campaign Id, but that isn't the reason for your error, the field isn't an Id field, it's a resource name field. The correct way to request is SELECT ad_group_asset.ad_group, ad_group_asset.asset FROM ad_group_asset WHERE ad_group_asset.ad_group = \'customers/{CID}/adGroups/{adgroupId}\'.

Since AdGroup is a segmenting resource in ad_group_asset, if there are no metrics no rows will be returned.

Денис Грязев

unread,
Nov 24, 2021, 12:53:59 AM11/24/21
to AdWords API and Google Ads API Forum
Hi, fixed on customers/{ CID }/ adGroups/{ adgroupId}. But now I get this error
[2021-11-24T08:46:24.398981+03:00] google-ads.INFO: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v9.services.GoogleAdsService/SearchStream", CustomerId: 2472654488, RequestId: "WramNCmnuhng4OqacZpJnw", IsFault: 0, FaultMessage: "None".

On the request customers/2472654488/adGroups/134163680852 (http://joxi.ru/RmzaYYMtj41Y4r)
среда, 24 ноября 2021 г. в 00:56:29 UTC+3, adsapi:

Google Ads API Forum Advisor

unread,
Nov 24, 2021, 11:14:07 AM11/24/21
to smeta...@gmail.com, adwor...@googlegroups.com
Hi Денис,

There doesn't seem to be an error in the partial response you sent me.

My guess is nothing is returning since AdGroup is a segmenting resource in ad_group_asset, if there are no metrics no rows will be returned.

For me to diagnose definitively, could you privately provide us with the log of request and response to the API?
Message has been deleted

Google Ads API Forum Advisor

unread,
Nov 25, 2021, 9:35:12 PM11/25/21
to smeta...@gmail.com, adwor...@googlegroups.com
Hi Денис,

Thank you for providing more details to your concern.

I would like to inform you first that I am going to delete your latest post as it contains generated logs on your end. Please note that when sending logs, for privacy purposes, you can provide it via Reply privately to author option or send it instead on this email address googleadsa...@google.com if this option is not available.

Moving forward, ad_group_asset is used to retrieve the data and statistics between the link of ad group and asset-based extensions. With this, if you want to get the asset information of your responsive search ad (which is the only ad type in the provided ad group), then you may use the ad_group_ad_asset_view instead.

Regards,


Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2R9nyj:ref

Денис Грязев

unread,
Nov 26, 2021, 5:24:29 AM11/26/21
to AdWords API and Google Ads API Forum
Hi, thanks for latest answer.

Maybe I didn't understand you (or you didn't understand me). I need to get extensions (callouts, sitelinks, their data - text, description, URLs) that are bound to a specific group. Using ad_group_ad_asset_view and getting the announcement data (I don't need it). Can you tell me pls how to do this?

пятница, 26 ноября 2021 г. в 05:35:12 UTC+3, adsapi:

Google Ads API Forum Advisor

unread,
Nov 29, 2021, 1:25:10 AM11/29/21
to smeta...@gmail.com, adwor...@googlegroups.com

Hi Денис,

 

Thank you for providing more information.

 

You can query the AdGroupAsset resource to determine which assets are linked to the ad group. If you want to get more information about a specific asset associated with an ad group, you will need to make another query to the Asset resource.

 

Let me know if you have any further clarification.

 

Regards,

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 

Google Logo
Kevin Gil Soriano
Google Ads API Team
 


ref:_00D1U1174p._5004Q2R9nyj:ref

Денис Грязев

unread,
Nov 29, 2021, 2:53:14 AM11/29/21
to AdWords API and Google Ads API Forum
Hi.
I still can't get the lines from the ad_group_asset. My query log:

[2021-11-29T10:46:27.027021+03:00] google-ads.INFO: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v9.services.GoogleAdsService/SearchStream", CustomerId: 2472654488, RequestId: "RdGOt2_US6d37JljKZruSA", IsFault: 0, FaultMessage: "None"
[2021-11-29T10:46:27.029419+03:00] google-ads.DEBUG: Request

-------
Method Name: /google.ads.googleads.v9.services.GoogleAdsService/SearchStream
Host: googleads.googleapis.com
Headers: {
"x-goog-api-client": "gl-php\/7.4.3 gccl\/12.1.0 gapic\/12.1.0 gax\/1.10.0 grpc\/1.41.0 rest\/1.10.0",
"x-goog-request-params": "customer_id=2472654488",
"developer-token": "REDACTED",
"login-customer-id": "2888919473"
}
Request:
{"customerId":"2472654488","query":"SELECT ad_group_asset.ad_group, ad_group_asset.asset FROM ad_group_asset WHERE ad_group_asset.ad_group IN ('customers\/2472654488\/adGroups\/134163680852')"}

Response
-------
Headers: {
"request-id": "RdGOt2_US6d37JljKZruSA",
"date": "Mon, 29 Nov 2021 07:46:27 GMT",

"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
}
Response:
None  
понедельник, 29 ноября 2021 г. в 09:25:10 UTC+3, adsapi:

Google Ads API Forum Advisor

unread,
Nov 30, 2021, 11:22:33 AM11/30/21
to smeta...@gmail.com, adwor...@googlegroups.com
Hi Денис,

My apologies for not realizing this, you don't have assets based extensions, you have the deprecated Extension Setting Services. I ran an ad_group_extension_setting report and found all your adGroup extensions. This account must have opted out of the migration schedule and these extensions weren't converted into assets yet.


Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 
Regards,
 
Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2R9nyj:ref

Денис Грязев

unread,
Dec 13, 2021, 4:48:35 AM12/13/21
to AdWords API and Google Ads API Forum
Hi. There is another question) How do I switch a new account immediately to Asset, for example, for the 278-461-2703 account.

I created an account today, created extensions and it was created on the basis of Feed, although I should be immediately based on Asset. Or am I wrong?

Thank you.
вторник, 30 ноября 2021 г. в 19:22:33 UTC+3, adsapi:

Google Ads API Forum Advisor

unread,
Dec 13, 2021, 12:38:46 PM12/13/21
to smeta...@gmail.com, adwor...@googlegroups.com
Hi Денис,

You can start right away to use asset based extensions in the API in a new account, this would cause the account to be migrated for that type of asset based extension.

You can also migrate your extensions, this would also cause the account to be migrated for that type of asset based extension. Feel free to get back to us.

Денис Грязев

unread,
Dec 14, 2021, 2:13:10 AM12/14/21
to AdWords API and Google Ads API Forum
So how do I start using resource-based extensions right away? That when creating extensions from the interface, I immediately created them based on Assets
понедельник, 13 декабря 2021 г. в 20:38:46 UTC+3, adsapi:

Google Ads API Forum Advisor

unread,
Dec 14, 2021, 11:54:56 AM12/14/21
to smeta...@gmail.com, adwor...@googlegroups.com
Hi Денис,

We have no visibility on UI extension creation, you may follow up with product support on that.

Auto migration is still going on and not every account got auto migrated yet. To guarantee that you have asset based extensions you can follow our migrating extensions guide for already created extensions, and  created new extensions by following our asset based extensions guide. Feel free to get back to us.
Reply all
Reply to author
Forward
0 new messages