Review Search
Adding FAQ Search to your FAQ Page
Add this code to your Product page
Minimum Height should be 300 and change height to what you need.
Update the div style according to your brand styles.
Add your CLIENT_ID to src
<div style="margin: 50px auto; display: flex;width: 100%;align-items: center;justify-content: center;">
<iframe id="reviewsIframeSearch"
src="https://chat.discoverist.ai/clients?clientid={CLIENT_ID}&assitant_mode=reviews_search"
height="300px"
width="100%"
style="background-color: white;border :none">
</iframe>
</div>
Go to Discoverist Dashboard to enable Review Search
Add the JavaScript code to your page
Get the Product Data and send it to the Product Object
Send the user_id if it is available.
const reviewsIframeElement = document.getElementById("reviewsIframeSearch");
const eventType = (event && event.data && event.data.type) || "";
switch (eventType) {
case "Discoverist-Connection-Established":
const clientInitEventData = {
id: "100",
type: "Client-Init-Data",
data: {
user_id: "{user_id}",
product: {
id: "{Product Id}",
name: "{productName}",
price: "{Price}",
},
},
};
reviewsIframeElement.contentWindow.postMessage(
clientInitEventData,
"https://chat.discoverist.ai"
);
}
}
Last updated