Hi community!
I noticed an error in Google Search Console that started occurring August 16 where there is a JSON parsing error.
The error is:JSON parsing error: Invalid token ] } .
The code snippet that caused the error:
},
The error is only appearing on my Collections pages. Here is the JSON snippet from Shopify:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "ItemList",
"itemListElement": [
{%- for product in collection.products -%}
{% if product.type=='giftbox_ghost_product' %}{%continue%}{%endif%}
{
"@type": "ListItem",
"position": {{ forloop.index | json }},
"url": {{ product.url | json }},
"name": {{ product.title | json }}
}
{% unless forloop.last %},{% endunless %}
{%- endfor -%}
]
}
</script>
An example page that has this error is: https://www.wishgardenherbs.com/collections/respiratory-wellness
I cannot figure out the error. Does anyone have a guess?
Thank you,
Bill