by lneibauer » Tue Feb 16, 2021 8:21 am
Hay all,
I know it has been a while since I replied to this thread but I mostly got my issue resolved and I want to thank all of you especially David for your input. I have one issue in my JSON script that I can't seem to figure out. Any product with a single quote in the PRODUCT.MoreInformationMetaDescription I am getting a google error: Bad escape sequence in string. and it seems to hover around that darn single quote or apostrophe. Does anyone know a workaround for this?
When I run it though the Google Structered TEsting Tool or the Rich Restults tests.
I get the above Error. Here is an example URL of one of the items with the issue: https://www.churchsupplier.com/shopsite_sc/store/html/155-kids-can-help-offering-boxes.html
below is the code I have implemented:
<script type="application/ld+json">{"@context": "http://schema.org/",
"@type": "Product",
"name": "[-- PRODUCT.Name JS_ENCODE --]",
[-- IF PRODUCT.SKU --] "sku": "[-- PRODUCT.Sku --]",[-- END_IF --]
"image": [[-- IF PRODUCT.MoreInformationGraphic --]"[-- PRODUCT.MoreInformationGraphic URL_ONLY --]"[-- ELSE_IF PRODUCT.Graphic --]"[-- PRODUCT.Graphic URL_ONLY --]"[-- END_IF --]
[-- FOR VAR.I 1 20 --][-- IF PRODUCT.MoreInfoImage[VAR.I] --],"[-- PRODUCT.MoreInfoImage[VAR.I] SS_SIZE0 URL_ONLY --]"[-- END_IF --][-- END_FOR --]],
[-- IF PRODUCT.MoreInformationMetaDescription --] "description": "[-- PRODUCT.MoreInformationMetaDescription JS_ENCODE --]",[-- END_IF --]
[-- IF PRODUCT.GoogleMPN --] "mpn": "[-- Product.GoogleMPN --]",[-- END_IF --]
[-- IF PRODUCT.GoogleGTIN --]"gtin": "[-- Product.GoogleGTIN --]",[-- END_IF --]
[-- IF PRODUCT.Brand --] "brand": {"@type": "Thing","name": "[-- PRODUCT.Brand JS_ENCODE --]"},[-- END_IF --]
[-- IF REVIEWS --][-- IF REVIEWS_COUNT_NUMBER GE 1 --] "aggregateRating": {"@type": "AggregateRating","ratingValue": "[-- REVIEWS_STARS_NUMBER --]",
"reviewCount": "[-- REVIEWS_COUNT_NUMBER --]"},[-- END_IF --][-- END_IF --]
[-- IF PRODUCT.DisplayPrice --] "offers": {"@type": "Offer","priceCurrency": "[-- STORE.CurrencyCode --]","price": "[-- IF PRODUCT.SaleAmount --][-- IF PRODUCT.SaleOn --][-- PRODUCT.SaleAmount RAW_NUMBER --][-- ELSE --][-- PRODUCT.Price RAW_NUMBER --][-- END_IF --][-- ELSE --][-- PRODUCT.Price RAW_NUMBER --][-- END_IF --]","priceValidUntil":"2025-07-30",
[-- IF STORE.Name --]"seller": {"@type": "Organization","name": "[-- STORE.Name JS_ENCODE --]","url":"https://www.churchsupplier.com/"},[-- END_IF --]"itemCondition": "[-- PRODUCT.GoogleCondition --]","availability": "[-- IF PRODUCT.GoogleAvailability "in stock" --]InStock[-- ELSE_IF PRODUCT.GoogleAvailability "out of stock" --]OutOfStock[-- ELSE --]PreOrder[-- END_IF --]","url":"[-- PRODUCT.MoreInfoURL --]"}[-- END_IF --]}
</script>
Any help would be appreciated. Thanks