-5

My company is trying out google's recommendation AI using BQ exports of merchant center and GA data sources. However, we discovered a configuration error in the merchant feed which led to most of the events being unjoined.

I would like to do a new (clean) setup and am looking for the best way to delete the old data. It seems only possible via the API? Secondly, while the UserEventService has a purge function, there doesn't seem to be a similar function for the ProductService.

Is deleting each product one by one the only way to go?

Any pointers and examples (Python) would be greatly appreciated as there seems to be very little documentation about this at this point in time.

santi
  • 119
  • 6
Tomas VdB
  • 41
  • 4

1 Answers1

0

As you mentioned, the only way to delete data is through the API, you can use Google Cloud Client Libraries or use REST requests; however, the library does not have a function to purge all the Product data. In this case will be necessary to delete one product at a time by using the delete_prod() function (example).

Nevertheless, as a workaround you can get the id product get_product()function (example) of your products and add them into a collection, then, iterate this collection and pass each value into the delete_prod(). In that way you can delete all the data products, but this needs to be reviewed on your side.

Additionally, I would like to share additional information provided by Google where you can find all related to Python Library.

Retail Docs API, Python Retail library, GitHub Repository Retail API

Please keep in mind that Stackoverflow is for specific questions about code such as errors.

  • Thanks Narda, I really appreciate the feedback as opposed to just downvotes. re the purpose of stack overflow, I wouldn't have asked this question if i hadn't exhausted all other sources of information, and unfortunately this is a new google product with very little few user docs or advise on implementation (and it seems plenty of API bugs). So i was hoping to solicit some actual code examples, possible solutions or workarounds. In in my mind this would have been useful enough to other users to warrant a 'no code' question and create a starting point for others with similar issues. – Tomas VdB Jul 06 '21 at 09:28
  • I understand, however, I would recommend that you start using the API based on the documentation provided. If you are stuck in something related to your code, and you have already done research previously, you can open a question on stackoverflow so that the community can help you. – Narda Monserrat Jul 06 '21 at 21:20