Skip to main content

SEO Schema Markup

The Amplify Widgets can automatically inject structured review data into your page to help achieve Rich Snippets (star ratings in search results).

To avoid duplicating your business information (like name, address, or phone number), the widgets use Schema.org Node Linking. By providing the widget with your existing schema's @id, search engines automatically merge the review data with your existing entity.

Setup

Step 1: Add Your Existing Schema

Ensure your webpage already has a JSON-LD script defining your entity (e.g., Physician, Dentist, or LocalBusiness) with a unique @id:

<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Physician",
"@id": "https://clinic.com/dr-smith/#physician",
"name": "Dr. Smith",
"telephone": "555-0198",
"Address": "1234 abc Road"
}
</script>

Step 2: Configure the Widget Attributes

Pass the exact @id and @type into the widget's HTML placeholder using the data-schema-id and data-schema-type attributes:

<div
class="amplify-summary"
pg-amplify-widget-id="YOUR_APP_ID"
pg-amplify-person-id="YOUR_PROVIDER_ID"
data-schema-id="https://clinic.com/dr-smith/#physician"
data-schema-type="Physician"
></div>

Step 3: The Result

Once the widget fetches review data, it automatically injects a secondary JSON-LD script into the page's <head>:

<script type="application/ld+json" id="amplify-jsonld-123-456">
{
"@context": "https://schema.org",
"@type": "Physician",
"@id": "https://clinic.com/dr-smith/#physician",
"name": "Dr. Smith",
"telephone": "555-0198",
"Address": "1234 abc Road",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": 4.9,
"ratingCount": 120,
"reviewCount": 85
}
}
</script>

Because both scripts share the same @id, Google's crawler stitches them together into one unified entity, attributing the ratings to your business.

note

JSON-LD injection is completely opt-in. If you omit the data-schema-id attribute, the widget skips schema injection. Both data-schema-id and data-schema-type are required to generate valid Schema.org nodes.

What Data Is Injected?

The data included in the JSON-LD depends on which widget type is embedded.

Summary Widget

The summary widget only downloads high-level metrics. The injected JSON-LD contains only the aggregateRating object:

"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": 4.9,
"bestRating": 5,
"ratingCount": 120,
"reviewCount": 85
}

Included: overall rating value, total rating count, total review/comment count.

Detail Widget

The detail widget downloads full review data. The injected JSON-LD contains aggregateRating and a review array with up to 10 of the most recent reviews:

"review": [
{
"@type": "Review",
"author": { "@type": "Person", "name": "Verified Reviewer" },
"reviewRating": { "@type": "Rating", "ratingValue": 5, "bestRating": 5 },
"reviewBody": "Dr. Smith was amazing and took the time to listen...",
"datePublished": "2024-01-15"
}
]

Included: all aggregate metrics (same as summary) plus up to 10 individual review objects with author name, star rating, review text, and publish date.

Best Practice

If you have both the summary and detail widgets on the same page, the detail widget's richer data fetch powers the JSON-LD injection, giving search engines access to both your aggregate score and your top reviews.

See the Reference for details on the data-schema-id and data-schema-type attributes.