How to search campaign level data from feed_item

130 views
Skip to first unread message

Xueyao Yang

unread,
Oct 18, 2020, 11:37:03 PM10/18/20
to AdWords API and Google Ads API Forum
Hello,

I want to search from feed_item, I can get some data with query
"SELECT feed_item.policy_infos, feed_item.resource_name, feed_item.status FROM feed_item"
but I get nothing with query
"SELECT campaign.resource_name, feed_item.policy_infos, feed_item.resource_name, feed_item.status FROM feed_item"
or query
"SELECT campaign.resource_name, feed_item.policy_infos, feed_item.resource_name, feed_item.status FROM feed_item WHERE campaign.resource_name in {...}"
The different is just "campaign.resource_name".
So I want to know how could I get data with campaign.resource_name filter?

Thank you

Google Ads API Forum Advisor Prod

unread,
Oct 19, 2020, 3:55:22 AM10/19/20
to yangx...@gmail.com, adwor...@googlegroups.com
Hi,

Thanks for posting your concern.

To investigate the issue, could you provide the complete Google Ads Query Language statement that you've used upon retrieving the empty reports together with customer ID? You can provide the requested details via Reply privately to author option.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q26AFo3:ref

Xueyao Yang

unread,
Oct 19, 2020, 5:49:57 AM10/19/20
to AdWords API and Google Ads API Forum
Thank you for your reply,
The request is 
           new SearchGoogleAdsRequest
            {
                PageSize = 10,
                CustomerId = 6360593950,
                Query =  @"SELECT
                            campaign.resource_name,
                            feed_item.policy_infos,
                            feed_item.resource_name,
                            feed_item.status
                            FROM feed_item"
            };
or
           new SearchGoogleAdsRequest
            {
                PageSize = 10,  
                CustomerId = 6360593950,
                Query =  @"SELECT
                            campaign.resource_name,
                            feed_item.policy_infos,
                            feed_item.resource_name,
                            feed_item.status
                            FROM feed_item
                       WHERE campaign.resource_name in ('customers/6360593950/campaigns/11394036621')"
            };
Search by Google.Ads.GoogleAds.V4.GoogleAdsService.

Xueyao Yang

unread,
Oct 19, 2020, 6:03:23 AM10/19/20
to AdWords API and Google Ads API Forum
And use C# code:
var client = new GoogleAdsClient();
client.Config.LoginCustomerId = 1148637041;
GoogleAdsServiceClient googleAdsService = client.GetService(Services.V4.GoogleAdsService).Search(request);

Google Ads API Forum Advisor Prod

unread,
Oct 19, 2020, 11:41:31 AM10/19/20
to yangx...@gmail.com, adwor...@googlegroups.com
Hello,

As an alternative, you can include other campaign related fields such as campaign.name or campaign.id and filter on those fields rather than campaign.resource_name. If you still face issues, please let me know.

Cheers,
Anthony
Google Ads API Team

Google Logo
Anthony
Google Ads API Team
 


ref:_00D1U1174p._5004Q26AFo3:ref

Xueyao Yang

unread,
Oct 20, 2020, 2:47:27 AM10/20/20
to AdWords API and Google Ads API Forum
Hi,

I add campaign.name or campaign.id in selected fields , but get null response. It seems that query included any campaign/ad_group/ad_group_ad related fields will return null response . But use the query  "SELECT feed_item.policy_infos, feed_item.resource_name, feed_item.status FROM feed_item"  can get  data. Does that mean we can only query feed_item related fields from feed_item? It confuses me.

Thanks

Google Ads API Forum Advisor Prod

unread,
Oct 20, 2020, 1:09:52 PM10/20/20
to yangx...@gmail.com, adwor...@googlegroups.com
Hello,

You should also be able to get feed item data using the extension_feed_item report. Please try this report and let me know if you still face issues.

Xueyao Yang

unread,
Oct 20, 2020, 11:40:37 PM10/20/20
to AdWords API and Google Ads API Forum

Thanks for your reply.
I could get  feed item related data from feed_item/extension_feed_item, but I couldn't get campaign related data from  feed_item/extension_feed_item.
If I query campaign.id/campaign.resource_name from feed_item/extension_feed_item without filter, I cannot get data .
The question is,
I could not get data when I put campaign related fields in query from feed_item/extension_feed_item, but could get data by removing campaign related fields in query.
For example,
the query "SELECT campaign.idfeed_item.policy_infos, feed_item.resource_name, feed_item.status FROM feed_item" return empty response,
but the query "SELECT feed_item.policy_infos, feed_item.resource_name, feed_item.status FROM feed_item" return some data.

Thank you

Google Ads API Forum Advisor Prod

unread,
Oct 21, 2020, 11:30:03 AM10/21/20
to yangx...@gmail.com, adwor...@googlegroups.com
Hello,

Since campaign related fields are segmenting resources, it will exclude any zero impression rows from your report.

Regards,
Reply all
Reply to author
Forward
0 new messages