How to prevent javascript values inside JSON+LD automatically encoded?

17 Views Asked by At

I'm using Google Tag Manager to add a JSON+LD script to my Project detail page. I created a couple of Variables, used Javascript to set value into them, and used it in the Tags to insert JSON+LD to my Project detail page. The thing is my URL inside JSON+JD keeps automatically changing to encoded. https:\/\/domain.com\/products\/image.jpg?v\x3dversionId That's fine, but Google gives Bad escape sequence in string error.

How can I solve this?

I tried to decode the URL using decodeURIComponent but it does not work.

0

There are 0 best solutions below