Giter VIP home page Giter VIP logo

Comments (13)

reconrad45 avatar reconrad45 commented on August 18, 2024 1

Thanks @samthaman for the help, finally getting a grip on how this works.

from shopifyscripts.

samLozier avatar samLozier commented on August 18, 2024

can you paste your code here? It's important that you clear all css and have this as your first line:
{% layout none %}<?xml version="1.0"?>``

from shopifyscripts.

reconrad45 avatar reconrad45 commented on August 18, 2024

Thanks sam, I thought the first line needs to be {% section 'collection-template' %} in order to assign the template to collections. I am getting the same error as powerflow in that facebook product catalog says it is an html page. Also, I am still getting the google_product_catalog error even when i use the facebook feed by flexify. In order to troubleshoot, I only added 5 products to the fb-product-feed colleciton.

In google shopping app, I selected the collection and tried to publish.. received the following error.
image

I receive the following error in facebook product catalog fetch (after I re-added {% section 'collection-template' %} at the top of the template because when I took it out it provided a different error that there were no products.

Without {% section...} code
image

With section code added back in
image

So in summary, facebook catalog doesn't like the format, and google shopping app says that the google_product_discription or catalog isn't provided and facebook gives the same error even when i use facebook feed by flexify.

Any insight would be appreciated.

from shopifyscripts.

reconrad45 avatar reconrad45 commented on August 18, 2024

Also if I might add, by adding the {% section 'collection-template' %} at the top of the template I get a hybrid of broken html (images not aligned, etc) and the lower half of the page seems to be a huge block of text of products, description, variants etc, but no xml code present, just standard text & links when going directly to the URL in the browser.

from shopifyscripts.

reconrad45 avatar reconrad45 commented on August 18, 2024

Of course I am just learning all of this so I am trying to be as clear as possible (probably not working lol)

but here is what I get in the google shopping app even when I point it to a specific collection, (not the facebook feed collection)
image

Regardless of pointing to the a specific collection or the facebook feed collection that I created, I get the same error in google shopping app..

from shopifyscripts.

samLozier avatar samLozier commented on August 18, 2024

@reconrad45 each product needs to be assigned to a google shopping category so that google and FB (FB uses the same categories) know what type of product you're selling. You can assign the categories during a .csv product upload to shopify, or through the Shopify Google Shopping App.

Until you have your google taxonomy memorized, I've found that it's easier and more accurate to assign categories through the google shopping app after I've published a product

More on the google taxonomy here:
https://support.google.com/merchants/answer/6324436?hl=en

from shopifyscripts.

samLozier avatar samLozier commented on August 18, 2024

This is the code that's currently live on my site for google. Once you have categories assigned, you should start seeing good results with this.

{% layout none %}<?xml version="1.0"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
{% paginate collection.products by 350 %}
{% assign useSEOtitle = false %}
{% assign useSEOdescription = false %}
{% assign CountryCode = 'US' %}
{% if shop.currency == 'CAD' %}{% assign CountryCode = 'CA' %}{% endif %}
{% assign Color = "" %}
{% assign Size = "" %}
<channel>
<title>{{ shop.name }} {{ collection.title | strip_html | strip_newlines | replace: '&', '&amp;' }}</title>
<link>{{ shop.url }}</link>
<description>{{ collection.description | strip_html | strip_newlines | replace: '&', '&amp;' }}</description>
{% for product in collection.products %} 
  {% assign GoogleProductCategory = product.metafields.google.google_product_type %}
  {% assign Gender = product.metafields.google.gender %}
  {% assign AgeGroup = product.metafields.google.age_group %}
      
  {% for variant in product.variants %}
    {% for option in product.options %}
  	{% if option == 'Color' %}{% capture Color %}{{ variant.options[forloop.index0] }}{% endcapture %}
  	{% elsif option == 'Size' %}{% capture Size %}{{ variant.options[forloop.index0]  }}{% endcapture %}
  	{% endif %}
  	{% endfor %}
    
    {% capture productTitle %}{{ product.vendor }} {{ product.title }} {{ Color }}{% endcapture %}
    {% if useSEOtitle and product.metafields.global.title_tag.size > 0 %}{% assign productTitle = product.metafields.global.title_tag %}{% endif %}
    {% assign productDescrition = product.description %}
    {% if useSEOdescription and product.metafields.global.description_tag.size > 0 %}{% assign productDescrition = product.metafields.global.description_tag %}{% endif %}

<item>
<title>{{ productTitle | replace: '&', '&amp;' }}</title>
<link>{{ shop.url }}{{ variant.url }}</link>
<description>{{ productDescrition | strip_html | strip_newlines | replace: '&', '&amp;' }}</description>
<g:google_product_category>{{ GoogleProductCategory | replace: '&', '&amp;'  }}</g:google_product_category>
<g:item_group_id>shopify_{{ CountryCode }}_{{ product.id }}</g:item_group_id>
<g:id>shopify_{{ CountryCode }}_{{ product.id }}_{{ variant.id }}</g:id>
<g:condition>new</g:condition>
<g:price>{{ variant.price | money_without_currency }} {{ shop.currency }}</g:price>
<g:availability>{% if variant.available %}in stock{% else %}out of stock{% endif %}</g:availability>
<g:image_link>http:{% if variant.image.src %}{{ variant.image.src | product_img_url: 'grande' }}{% else %}{{ product.featured_image.src | product_img_url: 'grande' }}{% endif %}</g:image_link>
<g:gtin>{{ variant.barcode }}</g:gtin>
<g:brand>{{ product.vendor }}</g:brand>
<g:mpn>{{ variant.sku }}</g:mpn>
<g:product_type>{{ product.type }}</g:product_type>
<g:age_group>{{ AgeGroup }}</g:age_group>
{% unless Color == "" %}<g:color>{{ Color | strip_html | strip_newlines | replace: '&', '&amp;' }}</g:color>{% endunless %}
{% unless Size == "" %}<g:size>{{ Size | strip_html | strip_newlines | replace: '&', '&amp;' }}</g:size>{% if product.type == "Apparel" %}<g:size_system>US</g:size_system>{% else %}{% endif %}{% endunless %}
<g:gender>{{ Gender }}</g:gender>
<g:custom_label_0>{{ product.metafields.google.custom_label_0 }}</g:custom_label_0>
<g:custom_label_1>{{ product.metafields.google.custom_label_1 }}</g:custom_label_1>
<g:custom_label_2>{{ product.metafields.google.custom_label_2 }}</g:custom_label_2>
<g:custom_label_3>{{ product.metafields.google.custom_label_3 }}</g:custom_label_3>
<g:custom_label_4>{{ product.metafields.google.custom_label_4 }}</g:custom_label_4>

<g:shipping_weight>{{ variant.weight | weight_with_unit }}</g:shipping_weight>
</item>

{% endfor %}
{% endfor %}
</channel>
</rss>
{% endpaginate %}

from shopifyscripts.

samLozier avatar samLozier commented on August 18, 2024

Final thought: are you assigning this template to your collection? That should happen on the collection page itself. You can select your template towards the bottom right.

from shopifyscripts.

reconrad45 avatar reconrad45 commented on August 18, 2024

Thanks @samthaman
"are you assigning this template to your collection?" Yep

image

"You can assign the categories during a .csv product upload to shopify, or through the Shopify Google Shopping App." I have been trying to find how to do this.. as I don't see anything in the google shopping app that lets me edit products and I don't see anything in products that lets me edit using the google shopping app.

from shopifyscripts.

samLozier avatar samLozier commented on August 18, 2024

In the app, click into a product and then change values as needed here:
capture

from shopifyscripts.

reconrad45 avatar reconrad45 commented on August 18, 2024

Ah that's it... I assumed that the link in google shopping app was a link to the product page.... hadn't realized that it was a link to adjust the specific google shop settings. Thanks.. now I am getting somewhere lol.

from shopifyscripts.

reconrad45 avatar reconrad45 commented on August 18, 2024

Progress:
image

Makes automation a bit cumbersome needing to go into each and assign a category as well as demands a color variant be created... and if an existing color variant does exist but isn't called straight up "color" it wants you to modify it to color.. i.e. rename "metal color" to just "color.

from shopifyscripts.

Czarto avatar Czarto commented on August 18, 2024

Seems like this is resolved. Sorry for not getting involved earlier. Thanks @samthaman for troubleshooting. Closing this issue.

from shopifyscripts.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.