<script type="application/ld+json"> tag containing your deployed schema — directly into the page <head> before it reaches the browser.
This approach avoids any JavaScript dependency for schema delivery, which benefits server-rendered CMS platforms, AMP pages, and sites where minimizing JavaScript execution is a priority for Core Web Vitals.
JS SDK vs Embed API
Use this table to decide which delivery method fits your setup:The Embed API response is cached by SchemaGen’s edge infrastructure using standard HTTP cache headers. Fetching it server-side on every page request is fast and will not add meaningful latency to your page load times.
The embed endpoint
Response: Plain HTML containing one or more
<script type="application/ld+json"> tags for every schema you have published for that URL. If no schemas are deployed for that URL, the response is empty — your page renders normally with no errors.
Code examples
- WordPress PHP
- Shopify Liquid
- Generic PHP
- JavaScript fetch
Add this snippet to your theme’s Place this call inside
functions.php or directly in the <head> section of header.php. It uses WordPress’s built-in HTTP API to fetch the schema and echoes the result into the page head.header.php
<head>...</head> so the structured data is included in the initial HTML document.How to find your client ID
Your client ID is a UUID assigned to your SchemaGen account. Find it in Dashboard → Settings → Client ID. It is the same identifier used in the JS SDK’sdata-client-id attribute:
How schema matching works
When the Embed API receives a request, it looks up all schemas you have published for the exact URL provided in theurl parameter. Make sure the URL you pass matches the canonical URL of the page as you have configured it in the SchemaGen dashboard. Including or excluding trailing slashes, query strings, or www inconsistently will result in no schemas being returned.