In order to have a Google Sitelinks Search Box for your website, you have to include this script in your page:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "https://www.example.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://query.example.com/search?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
My question is:
Can <script type="application/ld+json">
be external? It is obviously useless for page it self and crawlers can make extra request if they want.