Skip to main content

Set up RateParity as a widget

Copy the following script tag in your websites' HTML, preferably at the bottom of the <head> tag (just before the closing tag).

<script src="https://code.rateparity.com/versions/installer.min.js" defer></script>
warning

IF RATEPARITY IS NOT APPEARING
Try removing the script from optimization/cache plugins in website builders(Wordpress etc.)

The widget is configured to automatically display in the end user's default language. Furthermore, you have the option to modify this behavior by specifying the lang parameter when embedding the script.

Set Up RateParity modules as Webapps

This mode integrates a single Rateparity module(Price comparison, Reviews etc.) into a webpage, instead of the regular Rateparity widget. See more at https://www.rateparity.com/platform/webapps/.

  1. Copy the following script tag into your page's HTML
<script type="text/javascript" src="https://code.rateparity.com/versions/installer.min.js" data-parent-id="the-div-id" data-widget="the-widget" defer=""></script>
  1. Replace the data-parent-id attribute's value with the id of an html element that you have created in your page. This element will act as a container inside which Rateparity will render.

  2. Replace the data-widget attribute's value with the name of the Rateparity module you would like to embed, according to the following table:

Compatible modules

NameDescription
price-comparisonSuper fast Integrated Booking Engine
reviewsReview scores and details on your site to inspire user trust
offersSpecial Offers messaging feature
quoteTake control of your hotel’s offline bookings
vouchersVoucher tools to offer discounted room rates or extra services, like spa treatments, dining, and more.
giftcardsPrepaid codes that can be used as an alternative form of payment
meetingsMICE Booking Engine

Example

To embed the Reviews module in your page, create a <div id="example-container"></div> element at the place in your HTML where you would like Rateparity to appear, and then paste the script tag in the page's <head>.

The structure of your HTML should look like this:

<html>
<head>
<script type="text/javascript" src="https://code.rateparity.com/versions/installer.min.js" data-parent-id="example-container" data-widget="reviews" defer=""></script>
</head>
<body>
<div id="example-container"></div>
</body>
</html>

Set up the client API

See details about the client API at https://code.rateparity.com/docs/clientApi/introduction

Copy the following snippet at the beginning of the <head> tag, or at least before any client API command is used.
This will ensure any client API commands used before the main Rateparity script has loaded will not fail and will all be executed when it does.

<script>
window.rptCommandQueue = window.rptCommandQueue || [];
window.rpt = function(){window.rptCommandQueue.push(...arguments);}
</script>
caution

If this step is skipped, any client API command used before RateParity has finished loading will not work.

Selecting a language (optional)

If you need Rateparity to appear in a specific language, simply add a lang attribute to the script element. For instance, if you create a web page that showcases Italian content and you want Rateparity to match, the above script should be adjusted as follows:

<script type="text/javascript" lang="it" src="https://code.rateparity.com/versions/installer.min.js" defer></script>

The language parameter must adhere to the ISO 639-1 nomenclature.