This has nothing to do with the issue at hand - we are discussing catalogs, not rich pins.
I am still looking for some help on this. I have used this code to work on other feeds but for some reason Pinterest is giving me an error.
Here is what i have done using the code i used for other feeds, with a minor pinterest change (again this is not working, and maybe someone sees the error);
1- Make a new Collection called ‘Pinterest Feed’ - Make sure you add in ALL products that have inventory
2- Make a new Template collection.pinterest.feed.liquid
3- add the following code (Note the Google product Category will need to be built out based on your shops needs)
{% layout none %}<?xml version=“1.0”>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
{%- paginate collection.products by 1000 -%}
<channel>
{%- for product in collection.products -%}
{%- if product.variants.size > 0 -%}
{%- for variant in product.variants -%}
<item>
<g:id>shopify_US_{{ product.id }}_{{ variant.id }}</g:id>
<g:title>{{ product.title | strip_html | strip_newlines | replace: '&', '&' }}</g:title>
<g:description>{{ product.description | replace: '</', ' </' | strip_html | strip_newlines | replace: '&', '&' }}</g:description>
<g:link>{{ shop.url }}{{ variant.url }}</g:link>
<g:item_group_id>{{ product.id }}</g:item_group_id>
<g:availability>{% if product.available %}In Stock{% else %}Out of Stock{% endif %}</g:availability>
<g:condition>new</g:condition>
<g:Size_Type>regular</g:Size_Type>
<g:image_link>https:{% if variant.image.src %}{{ variant.image.src | product_img_url: 'grande' }}{% else %}{{ product.featured_image.src | product_img_url: 'grande' }}{% endif %}</g:image_link>
{%- if product.type contains "Kids" -%} <g:agegroup>kids</g:agegroup>
{% else %} <g:age_group>adult</g:age_group>
{% endif %}
<g:gtin>{{ variant.barcode }}</g:gtin>
{%- if product.type contains "Women" -%}<g:gender>Women</g:gender>
{%- elsif product.type contains "Men" -%}<g:gender>Men</g:gender>
{% else %} <g:gender>Unisex</g:gender>
{% endif %}
<g:mpn>{{ variant.sku }}</g:mpn>
<g:product_type>{{ product.type | replace: '&', '&' }}</g:product_type>
<g:google_product_category></g:google_product_category>
</item>
{% endfor %}
{% else %}
<item>
<g:id>shopify_US_{{ product.id }}_{{ variant.id }}</g:id>
<g:title>{{ product.title | strip_html | strip_newlines | replace: '&', '&' }}</g:title>
<g:description>{{ product.description | replace: '</', ' </' | strip_html | strip_newlines | replace: '&', '&' }}</g:description>
<g:item_group_id>{{ product.id }}</g:item_group_id>
<g:condition>new</g:condition>
<g:Size_Type>regular</g:Size_Type>
<g:availability>{% if product.available %}In Stock{% else %}Out of Stock{% endif %}</g:availability>
<g:image_link>https:{{ product.featured_image.src | product_img_url: 'grande' }}</g:image_link>
{%- if product.type contains "Kids" -%} <g:age_group>kids</g:age_group>
{% else %} <g:age_group>adult</g:age_group>
{% endif %}
<g:gtin>{{ product.barcode }}</g:gtin>
{%- if product.type contains "Women" -%}<g:gender>Women</g:gender>
{%- elsif product.type contains "Men" -%}<g:gender>Men</g:gender>
{% else %} <g:gender>Unisex</g:gender>
{% endif %}
<g:mpn>{{ product.sku }}</g:mpn>
<g:product_type>{{ product.type | replace: '&', '&' }}</g:product_type>
<g:google_product_category> </g:google_product_category>
</item>
{% endif %}
{% endfor %}
</channel>
</rss>
{% endpaginate %}
4- In your collection page change the template to the new Pinterest collection you have created.
In theory this should work, as it works with other feeds I currently use. However, i get the same error “Your Feed file has an XML formatting issue. Make sure you are missing a tag”
If anybody can see what i am missing that would be super helpful and it will solve everybody’s issue here as well.
thanks.
Ok I solved it. Had one small issue i overlooked. This now 100% works for me. You will need to add in your proper Google Product Categories based on how you store functions.
1- Make a new Collection called ‘Pinterest Feed’ - Make sure you add in ALL products that have inventory
2- Make a new Template collection.pinterest.feed.liquid
3- add the following code (Note the Google product Category will need to be built out based on your shops needs)
{% layout none %}<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
{%- paginate collection.products by 1000 -%}
<channel>
<title>Pinterest Date Feed</title>
<link>[Your Store NAME]</link>
<description>Feed for Pinterest catalog</description>
{%- for product in collection.products -%}
{%- if product.variants.size > 0 -%}
{%- for variant in product.variants -%}
<item>
<g:id>shopify_US_{{ product.id }}_{{ variant.id }}</g:id>
<g:title>{{ product.title | strip_html | strip_newlines | replace: '&', '&' }}</g:title>
<g:description>{{ product.description | replace: '</', ' </' | strip_html | strip_newlines | replace: '&', '&' }}</g:description>
<g:price>{{ variant.price | money_without_currency }} USD</g:price>
<g:link>{{ shop.url }}{{ variant.url }}</g:link>
<g:item_group_id>{{ product.id }}</g:item_group_id>
<g:availability>{% if product.available %}In Stock{% else %}Out of Stock{% endif %}</g:availability>
<g:condition>new</g:condition>
<g:Size_Type>regular</g:Size_Type>
<g:image_link>https:{% if variant.image.src %}{{ variant.image.src | product_img_url: 'grande' }}{% else %}{{ product.featured_image.src | product_img_url: 'grande' }}{% endif %}</g:image_link>
{%- if product.type contains "Kids" -%} <g:agegroup>kids</g:agegroup>
{% else %} <g:age_group>adult</g:age_group>
{% endif %}
<g:gtin>{{ variant.barcode }}</g:gtin>
{%- if product.type contains "Women" -%}<g:gender>female</g:gender>
{%- elsif product.type contains "Men" -%}<g:gender>male</g:gender>
{% else %} <g:gender>unisex</g:gender>
{% endif %}
<g:mpn>{{ variant.sku }}</g:mpn>
<g:product_type>{{ product.type | replace: '&', '&' }}</g:product_type>
<!--- Add your google product info here (and deleted this note)--->
{%- if product.type == "xxxx" -%}
<g:google_product_category>xxxxxxx</g:google_product_category>
{%- elsif product.type == "xxxxx"-%}<g:google_product_category>xxxxxx</g:google_product_category>
{% endif %}
</item>
{% endfor %}
{% else %}
<item>
<g:id>shopify_US_{{ product.id }}_{{ variant.id }}</g:id>
<g:title>{{ product.title | strip_html | strip_newlines | replace: '&', '&' }}</g:title>
<g:description>{{ product.description | replace: '</', ' </' | strip_html | strip_newlines | replace: '&', '&' }}</g:description>
<g:price>{{ product.price | money_without_currency }} USD</g:price>
<g:item_group_id>{{ product.id }}</g:item_group_id>
<g:condition>new</g:condition>
<g:Size_Type>regular</g:Size_Type>
<g:availability>{% if product.available %}In Stock{% else %}Out of Stock{% endif %}</g:availability>
<g:image_link>https:{{ product.featured_image.src | product_img_url: 'grande' }}</g:image_link>
{%- if product.type contains "Kids" -%} <g:age_group>kids</g:age_group>
{% else %} <g:age_group>adult</g:age_group>
{% endif %}
<g:gtin>{{ product.barcode }}</g:gtin>
{%- if product.type contains "Women" -%}<g:gender>female</g:gender>
{%- elsif product.type contains "Men" -%}<g:gender>male</g:gender>
{% else %} <g:gender>unisex</g:gender>
{% endif %}
<g:mpn>{{ product.sku }}</g:mpn>
<g:product_type>{{ product.type | replace: '&', '&' }}</g:product_type>
<!--- Add your google product info here (and deleted this note)--->
{%- if product.type == "xxxx" -%}
<g:google_product_category>xxxxxxx</g:google_product_category>
{%- elsif product.type == "xxxxx"-%}<g:google_product_category>xxxxxx</g:google_product_category>
{% endif %}
</item>
{% endif %}
{% endfor %}
</channel>
</rss>
{% endpaginate %}
4- In your collection page change the template to the new Pinterest collection you have created.
5- Go to pinterest and submit your new XML feed and wait 24 hours.
6- Enjoy.
I certainly hope this works…I’m not super tech savvy so can you explain a little more what you mean about the google product category needing to be built out?
Well it’s actually two things that are store specific based on the code i wrote. The Gender tag and the Google Product Category tag.
How I have done it is to use the ‘Product Type’ and map it to the Google Product Category. The one problem is, if you have a lot of products this is time consuming to map out. Hopefully you would only need to do it once. If you add additional Product Types later you would need to update this. I would not be able to answer how to do this, as it is store specific on how you named all your Product Types. It is possible to do this via tags as well, if your product types are not that gradular.
The gender tag is also store specific, as I mapped this our via ‘Product Type’ as well. If all your product types are not mapped out with gender specific verbiage, you can always do this via tags. Unlike the Google Product Category Tag this tag is not mandatory for pinterest (it will give you an alert, not an error). However this is a very important tag if you want to market directly to women/men. With Pinterest being heavily used by women over men, it makes sense to have this tag properly installed so you can save money in marketing costs.
Hello. I am not sure if I “Built the Google Out” Can you look at what I wrote? I think I may have done it wrong. I have 6 product types so I am not sure how elseif works when theres more than 2 options. Thank you in advance.
{% comment %}
The contents of the collection.liquid template can be found in /sections/collection-template.liquid
{% endcomment %}
{% section ‘collection-template’ %}
{% layout none %}<?xml version="1.0" encoding="UTF-8"?>
{%- paginate collection.products by 1000 -%} Pinterest Data Feed [https://sid-sam.myshopify.com/</link](https://sid-sam.myshopify.com/ Feed for Pinterest catalog{%- for product in collection.products -%}
{%- if product.variants.size > 0 -%}
{%- for variant in product.variants -%}
{%- if product.type == “tops” -%}
<g:google_product_category>194</g:google_product_category>
{%- elsif product.type == “bottoms”-%}<g:google_product_category>204</g:google_product_category>
{% endif %}
{%- if product.type == “accessories” -%}
<g:google_product_category>166</g:google_product_category>
{%- elsif product.type == “shoes”-%}<g:google_product_category>187</g:google_product_category>
{% endif %}
I am not much into google product category stuff. Can someone explain how can I add that? or is there any document? Where I need to setup google product category?
What should be final url to submit on data source? i Have tried storename,com/collections/pinterest-feed. but its not working because url should be on xml format. Can anyone help me with this?
Yes your url should just be page if you are doing it how I instructed.
example - https://YOURSTORE.com/collections/pinterest-feed
if you go to this page yourself.. you should see text only populate. If you have a lot of products lets say over 500, you maybe having an issue with it fully loading.
you need to get the google product category txt document from google and assign categories to products. Simple as that.
This cannot be done without that.
I’m following along here and trying to understand all of this. I don’t understand though where to find the google product category txt document from to set up the new template. While I’m at it…I’m not so good with code at all. If anyone has time to help I would greatly appreciate it. Thank you!
Im having this exact issue. Any resolution?
We are having the same issue using https://domain.com/collections/all.atom . Getting these errors
Issue type
Description
Occurrences
Error
description is missing from product metadata.
19
Error
google_product_category is missing from product metadata.
19
Error
link is missing from product metadata.
19
Error
image_link is missing from product metadata.
19
Error
availability is missing from product metadata. Possible values should be one of in stock, out of stock or preorder.
19
Error
The condition of the item is missing or the value provided is not an accepted one. Please specify whether the item is new, used or refurbished.
19
Error
price is missing from product metadata. Check that you are correctly sending a price of the form: <number> <currency>. Examples of valid price include 1.00USD and 1.00 USD. Do not include any currency symbols.
19
It seems we may have to create a custom feed .liquid page. But that is a bit much isn’t it? Hoping for a solution where we can just use one of the existing feed types.
Hi Celinie- mind showing me how you did this? I have been searching everywhere to figure it out!
Thanks!!
Hi! I am stuck on this last step as well. I have Broklyn theme if that helps. Do I need to install an app in shopify? Need to write code? is there a template somewhere? I’m really unsure about mapping product types to google product categories. All the help is appreciated!!!
I’m responding again bc my Pinterest profile was selected for their marketing partner program so I got a chance to ask a Pinterest expert about this. Their integrations with Shopify are in beta phase and are closed, that’s why nothing works and you can’t get answers.
My catalog still isn’t connected and I have to wait until they open beta testing again to even try or get help with it.
This doesn’t mean there isn’t a work around, it just means you all aren’t crazy, it doesn’t work.
I literally pinned every product from my site to my profile when I first opened my store. That works just as well bc the pins are shoppable.
Thank you! This information is very helpful! When you say pinned your products, do you mean you created a new pin from add pin button within the app or did you use the pin it button on your website to add pin to your profile?
I used the Pin it button on my website to create pins on my profile! I have
the boards to match the categories and make sure each Pin is linked back to
my site. You can click the tag to make sure it shows up as a product.
Still working on the code given by contributor. Here is the code that needs updating to deal with category and or other errors:
<!--- Add your google product info here (and deleted this note)--->
{%- if product.type == "xxxx" -%}
<g:google_product_category>xxxxxxx</g:google_product_category>
{%- elsif product.type == "xxxxx"-%}<g:google_product_category>xxxxxx</g:google_product_category>
{% endif %}
We have several product categories which we looked up at https://www.google.com/basepages/producttype/taxonomy-with-ids.en-US.txt
- Foot Powders 3049 Health & Beauty Personal Care Foot Care Foot Odor Removers
- Foot Sprays 3049 Health & Beauty Personal Care Foot Care Foot Odor Removers
- Anti-Chafe 567 Health & Beauty Personal Care Cosmetics Skin Care
- Muscle Balms 2915 Health & Beauty Personal Care
- Sunscreens 2844 Health & Beauty Personal Care Cosmetics Skin Care Sunscreen
- Hand & Foot Balms 2592 Health & Beauty Personal Care Cosmetics Skin Care Lotion & Moisturize
I understand that you can pick your own product types and just use names you like:
Unlike the google_product_category attribute, you choose which value to include. The values you submit for product_type can be used to organize the bidding and reporting in your Google Ads Shopping campaign.
and that for categories you choose the right category number. But if product_type is just what I want I doubt the if else statement would work as it does need to get the products in the correct collection…?
Can you show me an example of what the build out for the google product category would look like? Do I need to put the google product category where ALL of those red x’s are?
{%- if product.type == “xxxx” -%}
<g:google_product_category>xxxxxxx</g:google_product_category>
{%- elsif product.type == “xxxxx”-%}<g:google_product_category>xxxxxx</g:google_product_category>
{% endif %}
Should it look like this?
{%- if product.type == "luggage_&Bags > shopping_totes" -%}
<g:google_product_category>luggage&Bags > shopping_totes</g:google_product_category>
{%- elsif product.type == “xxxxx”-%}<g:google_product_category>luggage&_Bags > shopping_totes</g:google_product_category>
{% endif %}
Thanks in advance.