Recommendations

The Recommendations Plugin can be used to implement a standardized version of the Tweakwise recommendations in your platform. It supports both featured and up- and cross sell recommendations.

๐Ÿ”— View live demo of Recommendations

Installation

Make sure you have followed the Installation guide.

Initialization

The Recommendations Plugin needs to be initialized manually. You can choose to show either featured or up- and cross sell recommendations.

Featured recommendations

To add featured recommendations; copy the following snippet into your HTML. The snippet should be placed on the position of where you want the recommendations to appear.

<div id="featured-recommendations"></div>

<script>
  window.addEventListener("twn.recommendations.ready", function () {
    window.tweakwiseRecommendations({
      output: "#featured-recommendations",
      instancekey: "INSTANCEKEY",
      featured: {
        id: "ID"
      }
    });
  });
</script>

The only thing that is left is to replace INSTANCEKEY and ID with the correct values.

The INSTANCEKEY should be replaced with your own instance key. You can find it in Tweakwise on the Connectivity > Endpoints page.

The ID should be replaced with the unique featured recommendations ID. You can find this ID inTweakwise.

Up- and cross sell recommendations

To add up- and cross sell recommendations; copy the following snippet into your HTML. The snippet should be placed on the position of where you want the recommendations to appear.

<div id="related-recommendations"></div>

<script>
  window.addEventListener("twn.recommendations.ready", function () {
    window.tweakwiseRecommendations({
      output: "#related-recommendations",
      instancekey: "INSTANCEKEY",
      related: {
        productId: "PRODUCTID",
        groupKey: "GROUPKEY"
      }
    });
  });
</script>

The only thing that is left is to replace the INSTANCEKEY, PRODUCTID and GROUPKEY with the correct values.

The INSTANCEKEY should be replaced with your instance specific key.

the PRODUCTID should be replaced with the ID of the product for which you want to show recommendations.

the GROUPKEY should be replaced with the group key that is linked to the up- and cross sell recommendations. You can find this key in Tweakwise.