Note: Display 3 documentation is provided as a courtesy for clients on this legacy version of PowerReviews. It is no longer supported. We recommend contacting your Account Manager to discuss upgrading to our newer Display 4.1 version as soon as possible.
A successful implementation requires integrating PowerReviews code into your PDP. We provide user-friendly code blocks for your team to use in this process.
Integrating Snippets and Displays
Insert the following code blocks to integrate Review Snippets and Displays into your product detail pages. Place the initialization code immediately after the opening <body> tag of your product page; place the other items in locations where you'd like them to be displayed.
In the Initialization Code example below, make the following replacements on your PDP:
- Lines 2 and 9: replace <MGID> with your Merchant Group ID
- Line 6: replace <Locale> with your site locale.
- Line 7: replace <PageID> with the page_id you established in the product feed.
If you are not using the On Demand solution, then update the value of src in Line 2 with the location of the full.js on your server and Line 9 with the location of the unpacked zip file on your server.
If you are not using Q&A, lines 10 and 11 are not required.
Initialization Code
Copy and paste the following code into the top of your product page.
<script type="text/javascript"
src="http://cdn.powerreviews.com/repos/<MGID>/pr/pwr/engine/js/full.js">
</script>
<script type="text/javascript">
var pr_locale="<Locale>"; //optional, will use default if not specified
var pr_page_id="<PageID>";
var pr_write_review='http://www.myStore.com/review.html?pr_page_id=' + pr_page_id;
var pr_zip_location="cdn.powerreviews.com/repos/<MGID>/pr/";
var pr_ask_question = pr_write_review + "&appName=askQuestion";
var pr_answer_question = pr_write_review + "&appName=answerQuestion&questionId=@@@QUESTION_ID@@@";
</script>
PowerReviews supports HTTPS with Display 3, but you should ensure that your calls being made to full.js and applaunch.js are either HTTPS or protocol agnostic.
Review Snippet
Copy and paste the following code into your product page where you would like the Review Snippet to appear on your PDP.
<div class="pr_snippet_product">
<script type="text/javascript">POWERREVIEWS.display.snippet(document);</script>
</div>
Review Display
Copy and paste the following code into your product page where you would like the Review Display to appear on your PDP.
<div class="pr_review_summary">
<script type="text/javascript">POWERREVIEWS.display.engine(document);</script>
</div>
Loading Content Asynchronously
The PowerReviews display engine has the ability to load asynchronously. This is particularly useful for single-page-mobile-applications. To do so, consider the following workflow:
1. Call full.js to render the content (just like above).
2. When navigating away from the page, run POWERREVIEWS.display.unmount() function to destroy the display.
3. Repeat as necessary.