This guide provides comprehensive instructions for implementing PowerReviews' Enhanced SEO solutions. Correctly implementing structured data (in JSON-LD format) is crucial for search engines to understand and display your product ratings and reviews, which can significantly improve your site's visibility and click-through rates.
Introduction
PowerReviews can automatically generate AggregateRating and Review schema markup based on the product data you provide. The implementation path you take depends on whether you already have your own Product schema present on your product pages.
If you are utilizing Shopify as your eCommerce platform, see Shopify SEO.
To learn more about validating your Enhanced SEO implementation, see Validating Enhanced SEO.
-
If you do NOT have your own
Productschema: PowerReviews' out-of-the-box solution will work automatically. There is no need to implement any of the options below. -
If you DO have your own
Productschema: It is essential to choose one of the following options. This will prevent your schema from "competing" with the PowerReviews schema, which could cause search engines to ignore both, negatively impacting your SEO. We recommend starting with Option 1, as it is the easiest approach to implement.
Option 1: Use the PowerReviews Out-of-the-Box (OOTB) Solution & Enhance It
This is the most straightforward approach if you already have a Product schema. You can simply embed your existing schema directly within the PowerReviews pwr.render() function. This merges your product data with the review data from PowerReviews into a single, complete schema.
Level of Effort: Low
How to Implement:
Place your Product schema information inside the subject object within the pwr("render", ...) function.
Please note: The following code is just one example of how this can be accomplished. The properties shown within the subject object are for illustrative purposes and do not represent a complete list of all possible Product schema fields. Further documentation on all available product schema properties can be found at https://schema.org/Product.
Example:
<script>
window.pwr = window.pwr || function () {
(pwr.q = pwr.q || []).push(arguments);
};
pwr("render", {
api_key: "39135c31-81c8-4de9-b325-45b0e285ec41",
locale: "en_US",
merchant_group_id: "13376",
merchant_id: "771982",
page_id: "ANDRE_SOFA_10",
review_wrapper_url: "../standalone.4.0.html?pageId=~~~PAGE_ID~~~",
/* YOUR PRODUCT SCHEMA GOES HERE */
subject: {
"@context": "https://schema.org",
"@type": "Product",
"name": "Andre Sofa",
"description": "Our Andre Sofa offers unparalleled comfort",
"url": "https://www.exampleurl.com/andre-sofa",
"image": "https://www.exampleimage.jpg",
"sku": "121",
"brand": "Example Brand",
"offers": {
"@type": "Offer",
"priceCurrency": "USD",
"url": "https://www.exampleurl.com/andre-sofa",
"price": "21.49",
"priceValidUntil": "2020/06/25",
"availability": "https://schema.org/InStock"
}
},
components: {
ReviewSnippet: "pr-reviewsnippet",
ReviewImageSnippet: "pr-imagesnippet",
ReviewDisplay: "pr-reviewdisplay"
}
});
</script>
Disabling Schema on Category Pages
Some search engines recommend not generating schema markup for category-level pages. If you are using PowerReviews Category Snippets, you can disable schema generation on these pages by adding the ENABLE_CLIENT_SIDE_STRUCTURED_DATA: false flag to your pwr.render() configuration for those specific components.
Example:
<script>
window.pwr = window.pwr || function () {
(pwr.q = pwr.q || []).push(arguments);
};
pwr("render", [
{
ENABLE_CLIENT_SIDE_STRUCTURED_DATA: false,
locale: "en_US",
merchant_group_id: "49047",
page_id: "7799373259",
merchant_id: "512774",
api_key: "ec8f9acb-be0e-489b-a6ff-3eed3811025e",
review_wrapper_url: "https://www.prdemostore.com/pages/write-a-review/?pr_page_id=___PAGE_ID___",
components: {
CategorySnippet: "snippet-7799373259"
}
},
{
ENABLE_CLIENT_SIDE_STRUCTURED_DATA: false,
locale: "en_US",
merchant_group_id: "49047",
page_id: "7772277707",
merchant_id: "512774",
api_key: "ec8f9acb-be0e-489b-a6ff-3eed3811025e",
review_wrapper_url: "https://www.prdemostore.com/pages/write-a-review/?pr_page_id=___PAGE_ID___",
components: {
CategorySnippet: "snippet-7772277707"
}
},
{
ENABLE_CLIENT_SIDE_STRUCTURED_DATA: false,
locale: "en_US",
merchant_group_id: "49047",
page_id: "7751057291",
merchant_id: "512774",
api_key: "ec8f9acb-be0e-489b-a6ff-3eed3811025e",
review_wrapper_url: "https://www.prdemostore.com/pages/write-a-review/?pr_page_id=___PAGE_ID___",
components: {
CategorySnippet: "snippet-7751057291"
}
}
]);
</script>Option 2: Use the on_render Callback
This option is for clients who want to maintain their own Product schema separately but need to incorporate PowerReviews' AggregateRating data into it. You will first disable the default PowerReviews schema and then use the on_render callback function to fetch the rating data and dynamically inject it into your existing schema.
Level of Effort: Medium
How to Implement:
- Contact PowerReviews Support: Request that they disable the default LD+JSON schema markup on your account. This is crucial to prevent conflicts.
-
Update your
pwr.render()function: Add theon_rendercallback to retrieve the data.
- The code below is just one example of how this can be accomplished and will likely need to be modified. All e-commerce platforms are different, and your specific implementation may vary.
- This example assumes your product schema has an ID of
productschema. You will need to adjust thegetElementByIdselector to match your site's unique structure. - The
on_rendercallback is designed to return only theaverage_ratingandreview_countvalues. It does not provide the full content of individual reviews. For that functionality, please see the documentation for theon_changecallback.
Example:
<script>
window.pwr = window.pwr || function () {
(pwr.q = pwr.q || []).push(arguments);
};
pwr("render", {
api_key: "39135c31-81c8-4de9-b25-45b0e285ec41",
locale: "en_US",
merchant_group_id: "49047",
merchant_id: "512774",
page_id: "7751057291",
review_wrapper_url: "ui.powerreviews.com/stable/standalone.html?pr_merchant_id=512774&pr_page_id=7751057291",
on_render: function(config, data) {
// Check for the right component and ensure rating data exists
if ((config.component === 'ReviewSnippet') && data.average_rating && data.review_count) {
var aggregateRating = {};
aggregateRating['@context'] = "http://schema.org/";
aggregateRating['@type'] = 'AggregateRating';
aggregateRating['ratingValue'] = data.average_rating;
aggregateRating['reviewCount'] = data.review_count;
// Find and update your existing product schema
var scriptTag = document.getElementById("productschema");
if (scriptTag) {
var scriptTagObject = JSON.parse(scriptTag.innerHTML);
scriptTagObject["aggregateRating"] = aggregateRating;
scriptTag.innerHTML = JSON.stringify(scriptTagObject);
}
}
},
components: {
ReviewSnippet: "pr-reviewsnippet",
ReviewDisplay: "pr-reviewdisplay"
}
});
</script>Option 3: Use the ReadServices API
This is the most advanced and flexible option, giving you complete control over building the schema. For this option, you will use the PowerReviews Read API to fetch all review and rating data.
This approach requires the most additional work on your end but also allows for a complete solution, as all relevant values can be retrieved from the API to build out the full Review Schema. This is in contrast to Option 2, which only allows for the average_rating and review_count to be returned.
This option also requires that the out-of-the-box (OOTB) PowerReviews schema be disabled for your account. This is a critical step that must be performed by the PowerReviews Support team. Once disabled, your development team will be responsible for using the API data to construct and embed the AggregateRating and Review schemas into your site.
Level of Effort: High
How to Implement:
- Contact PowerReviews Support: You must submit a request to get credentials for the Read API and to have the default OOTB schema markup disabled for your account.
- Develop an API Integration: Your development team will need to make calls to the PowerReviews Read API to retrieve all necessary review content (e.g., average rating, review count, individual review text, author, etc.).
-
Build and Embed the Schema: Use the data returned from the API to construct the full
AggregateRatingandReviewschemas and embed them within your site's product page templates.