Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.
Solved

How can I set Google MPN and Googel Category creating a product through the API

yeisonziruma
New Member
5 0 0

When importing some products with CSV files there are a lot of fields for google, How can I set those fields in the product when I create it through the API.

 

Google Shopping / Google Product CategoryGoogle Shopping / GenderGoogle Shopping / Age GroupGoogle Shopping / MPNGoogle Shopping / AdWords GroupingGoogle Shopping / AdWords LabelsGoogle Shopping / ConditionGoogle Shopping / Custom ProductGoogle Shopping / Custom Label 0Google Shopping / Custom Label 1Google Shopping / Custom Label 2Google Shopping / Custom Label 3Google Shopping / Custom Label 4

 

Accepted Solution (1)
Josh
Shopify Staff
1134 84 233

This is an accepted solution.

Hey again @yeisonziruma ! 

 

As far as the deprecation goes, I don't have details on that - you may want to see if your account manager can provide more info on what changes are being made. 

 

In the meantime though, it looks like the info is saved as metafields but those are not available at the product level. If you're looking at this product in your Shopify admin, try adding /metafields.json to the end of the URL - you should be able to see what you're after then. 

 

You can create metafields while creating a product as well, so you may want to experiment with this to see if you're able to create ones that are picked up by the Google Shopping app. But at the same time, if these are going to be deprecated I'm not sure if it would be worth the effort. I'd suggest clearing up exactly what changes are being made with your account manager first.

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

View solution in original post

Replies 4 (4)

Josh
Shopify Staff
1134 84 233

Hi @yeisonziruma , 

 

These fields are not accessible via the API that I'm aware of, at least not through our Product API. They may be saved as metafields on a product, however - but I'm not entirely sure off-hand. Do you have an example product that I could take a look at by chance?

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

yeisonziruma
New Member
5 0 0

According to our account manager, those fields are deprecated and will disappear soon, then I don't know how you classify or interact with google merchant.
Finally I though those fileds were meta fields values, but when you fetch a product thorugh the API these are not present, so it actually could mean that the fields are in the template to import products, but they are not actually processed any more.

This is the ID of one of our products, in a dev store
4015206662241

Josh
Shopify Staff
1134 84 233

This is an accepted solution.

Hey again @yeisonziruma ! 

 

As far as the deprecation goes, I don't have details on that - you may want to see if your account manager can provide more info on what changes are being made. 

 

In the meantime though, it looks like the info is saved as metafields but those are not available at the product level. If you're looking at this product in your Shopify admin, try adding /metafields.json to the end of the URL - you should be able to see what you're after then. 

 

You can create metafields while creating a product as well, so you may want to experiment with this to see if you're able to create ones that are picked up by the Google Shopping app. But at the same time, if these are going to be deprecated I'm not sure if it would be worth the effort. I'd suggest clearing up exactly what changes are being made with your account manager first.

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

yeisonziruma
New Member
5 0 0

Josh, Thanks a lot for the Help

I think I will add them just in case, and check the deprecation of that fields, because as far as I know google requires that info to publish the product.

 

Again, Thank you very much