I added dynamic structured data for recipes to my webiste, but the variable for the recipe image is not displayed correctly. The data layer autmatically adds two backslashes in front of every slash of the url. This causes problems with the rich snippet:
I am no programmer, just an SEO and my skills in HTML are very basic, so I would be very happy if anyone could help me out with that.
Thanks
Julia
2
Answers
It’s called
escaping
. the slashes are dual-meaning, they act both as a regular character and also as a programing indicator, so when you want to use them as regular char – you have to "escape" the programing meaning by adding a backslash before.If you want to make sure, that the escaping is removed in the rendered HTML, just create an additional JS var in GTM:
This should do the job…