4

I am trying to implement Schema.org markup (WebSite type):

<script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "WebSite",
        "url": "Page URL",
        "potentialAction": {
            "@type": "SearchAction",
            "target": "https://www.finelovedolls.com/fr/?s={search_term}&post_type=product",
            "query-input": "required name=search_term"
            }
    }
</script>    

It seems correct as the target is what my website returns as a variable URL when using the search box.

However, I get the following mistake on Google SDTT results:

URL Template: https://www.finelovedolls.com/fr/?s={search_term}&post_type=product (There is an error in your Sitelinks Search Box template: OFF_DOMAIN.)

unor
  • 92,415
  • 26
  • 211
  • 360
KVNHNF
  • 77
  • 2
  • 6

1 Answers1

2

Google’s Structured Data Testing Tool seems to check if the host from the target value is the same as the host from the url value.

So if you use "url": "https://www.finelovedolls.com/fr/" instead of "url": "Page URL", the testing tool shouldn’t report this error anymore.

unor
  • 92,415
  • 26
  • 211
  • 360
  • Hi Unor, thank you for your reply. I tagged the question in "Goggle Tag Manager" because I use it to dynamically inject variables into the JSON-LD. Sorry I forgot the brackets, it's: {{Page URL}} (built-in variable from GTM.) So your suggestion won't work unfortunately as I still need to have this data to be rendered dynamically...! – KVNHNF Apr 18 '17 at 22:37
  • Would that have something to do with Cloudflare...? – KVNHNF Apr 18 '17 at 22:43
  • But you checked the markup in [Google’s SDTT](https://search.google.com/structured-data/testing-tool?hl=en), right? I think it doesn’t execute any JavaScript, so you have to test your resulting HTML (with the correctly populated values) there, not your source (doesn’t matter if it uses GTM or any other way to populate the values). – unor Apr 18 '17 at 22:53