Liquid, JavaScript, themes, sales channels
Join us March 21 for an AMA on planning your 2023 marketing budget with 2H Media co-owners, Matt and Aron
Hello,
Do anyone know how to resolve this issue in the Google Search Console: "No global identifier provided (e.g., gtin, mpn, isbn)"? We use Debut theme.
Thanks!
Solved! Go to the solution
This is an accepted solution.
@EmmanuelFlossie, I found your article: https://feedarmy.com/kb/shopify-microdata-for-google-shopping/
Can you please advice? If I'll add the line (colored in red) shown below in the code to the Debut theme product.liquid template will it solve the issue? Thanks!
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"@id": {{ canonical_url | append: '#product' | json }},
"name": {{ product.title | json }},
"url": {{ shop.url | append: product.url | json }},
{%- if product.featured_media -%}
{%- assign media_size = product.featured_media.preview_image.width | append: 'x' -%}
"image": [
{{ product.featured_media | img_url: media_size | prepend: "https:" | json }}
],
{%- endif -%}
"description": {{ product.description | strip_html | json }},
"gtin12": {{ current_variant.barcode | json }},
{%- if current_variant.sku != blank -%}
"sku": {{ current_variant.sku | json }},
{%- endif -%}
"brand": {
"@type": "Brand",
"name": {{ product.vendor | json }}
},
"offers": [
{%- for variant in product.variants -%}
{
"@type" : "Offer",
{%- if variant.sku != blank -%}
"sku": {{ variant.sku | json }},
{%- endif -%}
"availability" : "http://schema.org/{% if variant.available %}InStock{% else %}OutOfStock{% endif %}",
"price" : {{ variant.price | divided_by: 100.00 | json }},
"priceCurrency" : {{ cart.currency.iso_code | json }},
"url" : {{ shop.url | append: variant.url | json }}
}{% unless forloop.last %},{% endunless %}
{%- endfor -%}
]
}
</script>
@Irenagtin, mpn, isbn are different barcode formats, so it's telling you that it can't find barcodes for those products. Have you added barcodes to the barcode field?
It is just a warning, not an error as such, so if your products don't have barcodes then that's fine. This only really comes into play if you intend on using Google Shopping, Amazon, eBay etc.
Yes, we added barcodes (UPC's) to the barcode fields. That's why I am curious why we are getting this error. We were manage to fix other errors in Google Search Console like "Brand" just by fixing the code, however we still haven't found the solution for the "No global identifier provided (e.g., gtin, mpn, isbn)" error. Shopify support also doesn't know how to do that.
@Irena Just checked a Debut based site with this tool https://search.google.com/test/rich-results and looks like debut doesn't output the GTIN field as structured data by default, so more code changes are required if it bothers you (as I said it's a warning, not an error).
There is an article here that talks you through how to fix it https://feedarmy.com/kb/shopify-microdata-for-google-shopping/
This is an accepted solution.
@EmmanuelFlossie, I found your article: https://feedarmy.com/kb/shopify-microdata-for-google-shopping/
Can you please advice? If I'll add the line (colored in red) shown below in the code to the Debut theme product.liquid template will it solve the issue? Thanks!
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"@id": {{ canonical_url | append: '#product' | json }},
"name": {{ product.title | json }},
"url": {{ shop.url | append: product.url | json }},
{%- if product.featured_media -%}
{%- assign media_size = product.featured_media.preview_image.width | append: 'x' -%}
"image": [
{{ product.featured_media | img_url: media_size | prepend: "https:" | json }}
],
{%- endif -%}
"description": {{ product.description | strip_html | json }},
"gtin12": {{ current_variant.barcode | json }},
{%- if current_variant.sku != blank -%}
"sku": {{ current_variant.sku | json }},
{%- endif -%}
"brand": {
"@type": "Brand",
"name": {{ product.vendor | json }}
},
"offers": [
{%- for variant in product.variants -%}
{
"@type" : "Offer",
{%- if variant.sku != blank -%}
"sku": {{ variant.sku | json }},
{%- endif -%}
"availability" : "http://schema.org/{% if variant.available %}InStock{% else %}OutOfStock{% endif %}",
"price" : {{ variant.price | divided_by: 100.00 | json }},
"priceCurrency" : {{ cart.currency.iso_code | json }},
"url" : {{ shop.url | append: variant.url | json }}
}{% unless forloop.last %},{% endunless %}
{%- endfor -%}
]
}
</script>
UPDATE: I just tried out my suggested solution from above and the error on GSC disappeared, so I guess it works.
Glad my article could help, and yes as long as you have barcodes, that line of code is correct.
I have GTIN error and MCN error with google as well. Where do you get the GTIN and MCN for Aliexpress products? I looked over all of Oberlo and Aliexpress and can not find them on any products that I import to my store. Please help so I can get my store unblocked from S.E. like Google and Bing.
User | RANK |
---|---|
21 | |
20 | |
13 | |
12 | |
8 |
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023