Get All Products in a campaign

431 views
Skip to first unread message

Siebert Looije

unread,
Jan 1, 2024, 8:01:34 PM1/1/24
to Google Ads API and AdWords API Forum
Hi,

I am trying to fetch all the products which are in the shopping_performance_view. However if I look at the response I get. These are only the products which has  > 0 impressions/spend but not the products which has no impressions or spend.

Is there a way to get all the products in a campaign from the Google Ads API?

Kind regards,

Siebert Looije

Google Ads API Forum Advisor

unread,
Jan 2, 2024, 2:51:14 AM1/2/24
to siebert...@billygrace.com, adwor...@googlegroups.com
Hi Siebert,

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

After reviewing your concern, I understand that you are able to fetch the products which have impressions/spend greater than zero but not the products which have no impressions or spend from the shopping_performance_view report via the Google Ads API.

With query results, you often want to obtain information about how your campaigns are performing. In this context, zero metrics may not be desirable. So, rows whose selected metrics are all zero won't be returned. I would recommend you to check this guide on Zero Metrics for more information.

I hope this helps. You can get back to us if you still have any issues/concerns related to the Google Ads API.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02r4kiM:ref"

Thanks,
 
Google Logo Google Ads API Team


Siebert Looije

unread,
Jan 2, 2024, 3:37:18 AM1/2/24
to Google Ads API and AdWords API Forum
Hi.

Thanks for responding. So indeed I am not looking for the performance of the campaigns. I am just trying to fetch which products are currently in the campaigns. What would be the best way to do this?

Kind regards,

Siebert

Op dinsdag 2 januari 2024 om 08:51:14 UTC+1 schreef Google Ads API Forum Advisor:

Google Ads API Forum Advisor

unread,
Jan 2, 2024, 7:16:13 AM1/2/24
to siebert...@billygrace.com, adwor...@googlegroups.com
Hi,

Thank you getting back to us.

Please note that API is just a reflection of UI, which means we can retrieve only the data from API that can be retrieved via UI. Could you please provide us with an uncropped screenshot of UI report(with a visible CID) which you want to retrieve via API so that we can analyse further.
 
You can send the details via Reply privately to the author option, or direct private reply to this email.
Message has been deleted

Siebert Looije

unread,
Jan 11, 2024, 4:50:02 PM1/11/24
to Google Ads API and AdWords API Forum
Hi,

I have sent the screenshots in the private message. Is there any update on this ticket?

Thanks,

Kind regards,

Siebert Looije

Op dinsdag 2 januari 2024 om 13:16:13 UTC+1 schreef Google Ads API Forum Advisor:

Google Ads API Forum Advisor

unread,
Jan 11, 2024, 5:07:30 PM1/11/24
to siebert...@billygrace.com, adwor...@googlegroups.com
Hi,

Thank you for getting back to us.

I would like to inform you that we have not received any logs from your end. By reviewing your concern, I understand that you want to fetch all the products from your campaigns. Kindly note that zero metrics entities are always excluded when a report is segmented. So, I would recommend you to try fetching the report without segmenting. 

We would require complete API logs (request and response with request-id and request header) generated at your end, so that we can assist you accordingly.

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.NetPHPPythonRuby 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.

Siebert Looije

unread,
Jan 16, 2024, 6:36:35 AM1/16/24
to Google Ads API and AdWords API Forum
Hi,

I have sent two times the uncropped picture of the GUI and the logs. Can you confirm you have received them?

kind regards,

Siebert

Op donderdag 11 januari 2024 om 23:07:30 UTC+1 schreef Google Ads API Forum Advisor:

Google Ads API Forum Advisor

unread,
Jan 16, 2024, 11:07:07 AM1/16/24
to siebert...@billygrace.com, adwor...@googlegroups.com
Hi Siebert,


Thank you for getting back to us.

I would like to inform you that we have not received any logs from your end. In order to investigate further, kindly provide us with earlier requested complete API logs (request and response with request-id and request header) generated at your end to assist you better.
Message has been deleted

Google Ads API Forum Advisor

unread,
Jan 17, 2024, 12:49:46 AM1/17/24
to siebert...@billygrace.com, adwor...@googlegroups.com
Hi,


Thank you for getting back to us.

Upon checking your Google Ads account (3896979811), I could see there are no metrics available for the products which you have shared in the UI screenshot. This is the reason why you are not able to retrieve the products information. Kindly note that Rows whose selected metrics are all zero won't be returned. I would recommend you to kindly refer to the "Returned rows with zero metrics" documentation for more information.
Message has been deleted

Google Ads API Forum Advisor

unread,
Jan 17, 2024, 3:55:22 AM1/17/24
to siebert...@billygrace.com, adwor...@googlegroups.com
Hi Siebert,


Thank you for getting back to us.

To get the products available in a campaign, you can use the below query:
  • Query: "SELECT campaign.id, segments.product_brand, segments.product_item_id, segments.product_title FROM shopping_performance_view where campaign.id='<campaign ID>'"
Additionally, you may refer to Google Ads Query Builder and Query Validator documentations to build and validate the queries.


I hope this helps. You can get back to us if you still have any issues/concerns related to the Google Ads API.

 

Siebert Looije

unread,
Jan 17, 2024, 6:32:10 AM1/17/24
to Google Ads API Forum Advisor, adwor...@googlegroups.com
Hi,

Thanks for getting back. Thanks for the query. Does this query give only the product item id which are currently (so now?) in the campaign or does this give all the product_item_id which where ever in the campaign?
As the product item id in the campaign can change every day and I would like to request only the product item id which are now in the campaign.

Kind regards,

Siebert

Op wo 17 jan 2024 om 09:55 schreef Google Ads API Forum Advisor <ads...@forumsupport.google>:


--

Met vriendelijke groeten / Kind Regards,

 

Siebert Looije

Tech lead & Senior Data scientist


Email: siebert...@billygrace.com

Website: www.billygrace.com  


Professor Tulpstraat 18, 1018 HA,

Amsterdam, The Netherlands


Google Ads API Forum Advisor

unread,
Jan 17, 2024, 8:39:33 AM1/17/24
to siebert...@billygrace.com, adwor...@googlegroups.com
Hi,


Thank you for getting back to us.

The provided query will fetch the product item id which is now in the campaign. Let me know how it goes after trying the provided suggestion. I hope this helps. Let us know if you still have any further clarifications.

Additionally, I would recommend you to refer to this documentation to know more about the Fields/Segments/Metrics that can be used with the campaign resource.
Message has been deleted

Google Ads API Forum Advisor

unread,
Jan 17, 2024, 3:29:48 PM1/17/24
to siebert...@billygrace.com, adwor...@googlegroups.com
Hi,

Thank you for getting back to us.

I would like to inform you that we're encountering compatibility issues with the file you shared, which is preventing us from opening it. To enable a more comprehensive investigation, could you please provide a shareable link to the spreadsheet, granting us public access?

Additionally, as previously requested, please provide us with the complete API logs (request and response with request-id and request header) in .txt format. This information will allow us to provide more effective assistance.
Message has been deleted

Google Ads API Forum Advisor

unread,
Jan 18, 2024, 5:03:06 AM1/18/24
to siebert...@billygrace.com, adwor...@googlegroups.com
Hi Siebert,


Thank you for getting back to us.

Kindly note that the provided response logs are not complete. So, in order to assist you further, kindly provide us with the "complete API logs" (request and response with request-id and request header) generated at your end.
Message has been deleted

Google Ads API Forum Advisor

unread,
Jan 18, 2024, 9:38:55 AM1/18/24
to siebert...@billygrace.com, adwor...@googlegroups.com
Hi,


Thank you for getting back to us.

Please be informed that I have removed your response from the forums as it contains the PII information.

I will check with our team regarding your issue and one of my team members will reach out to you once we have an update on this. Meanwhile, your patience is highly appreciated.

Google Ads API Forum Advisor

unread,
Jan 22, 2024, 12:14:02 PM1/22/24
to siebert...@billygrace.com, adwor...@googlegroups.com
Hello - 

I'm a developer relations engineer jumping in to help with this issue.

Before I start trying to address the discrepancy in the number of records you're receiving, can I ask what you're hoping to accomplish with this query? Do you just want to programmatically obtain a list of products being used in your PMax campaigns? Or do you want to retrieve metrics for campaigns/ads as well?

My initial thought is that since products are derived from your linked Merchant Center account, it probably makes more sense to obtain product information from the Shopping Content API. It's possible that the view you're seeing in the UI doesn't exist in the API. Depending on your use case I can recommend a path forward.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02r4kiM:ref"

Thanks,
 
Google Logo
Ben Karl
Google Ads API Team


Siebert Looije

unread,
Jan 22, 2024, 12:43:48 PM1/22/24
to Google Ads API Forum Advisor, adwor...@googlegroups.com
Hi Ben Karl,

Thanks for coming back to me. 
I want to programmatically obtain the list of products which are currently (as in now) being used in the PMax/shopping campaigns. I don't need to have any metrics linked to it, but I only want to have the product information from the products which are currently/now in the Pmax/shopping campaigns.

For me it is very important that it I don't receive  the products that were first in the campaigns and then being removed as well. So I want to capture if persons are switching products within the pmax/shopping campaigns. Hopefully this makes sense to you?

Furthermore I also want to have the products which are in campaign regardless if they have an impression/click, so even if they don't have any clicks but still active in the campaign, I would like to have them.

Hopefully this is clear.

Kind regards,

Siebert

Op ma 22 jan 2024 om 18:13 schreef Google Ads API Forum Advisor <ads...@forumsupport.google>:
Reply all
Reply to author
Forward
0 new messages