Darwin & Goliath Integration

JavaScript Client Integration

Integrating Darwin & Goliath in your website is easy, and requires, in the ideal case, only a few minutes. To integrate the Darwin & Goliath JavaScript client into your website, add the following snippet to the part of the page where recommendations are to be displayed (please contact us to receive your partner id):

<div id="dg-recommendations">
   <div id="dg-partner-id" style="display: none;">$YOUR_DG_PARTNER_ID$</div>
   <div id="dg-app-id" style="display: none;">$YOUR_DG_APP_ID$</div>
   <script src="https://storage.darwingoliath.com/javascript/jquery.min.js" type="text/javascript"></script>
   <script src="https://storage.darwingoliath.com/javascript/getRec.js" type="text/javascript"></script>
   <noscript> 
      <p id="dg-noscript">Please activate JavaScript to see a list of related items generated by <a href="https://darwingoliath.com/" target="_blank">
      Darwin &amp; Goliath</a>, the Recommendations-as-a-Service (RaaS) provider that delivers custom recommendations to your users,
      ready to run in minutes.</p> 
   </noscript> 
</div>

Metadata Availability

Darwin & Goliath needs access to your inventory metadata in order to generate its recommendations:

Required Metadata

<meta property="dg:item-original-id" content="The unique ID of the item">
<meta property="dg:item-title-or-name" content="The title or name of the item">

 

Recommended Metadata

<meta property="dg:user-original-id-hashed" content="The id (hashed) of the current user visiting the page">
<meta property="dg:session-original-id" content="The session id of the current user visiting the page">
<meta property="dg:item-description" content="A product description of the item">
<meta property="dg:item-category" content="Category of the item">
<meta property="dg:item-image-1-url" content="The URL of your first image">
<meta property="dg:item-image-1-dimensions" content="In pixels width x height like 300 x 400">
<meta property="dg:item-image-1-caption" content="A description of the image">
<meta property="dg:item-last-update" content="The date the item was last updated (including price update)">

 

Additional Metadata

<meta property="dg:item-keyword" content="A single keyword. Create additional tags for each keyword.">
<meta property="dg:item-type-main" content="The main type of the item, e.g. phone, router, tv">
<meta property="dg:item-type-sub" content="A sub-type of the item, e.g. foldable smartphone, wifi router, smart tv">
<meta property="dg:item-external-identifier" content="Key value pair of an external identifier, e.g. upc-a=042100005264">
<meta property="dg:item-first-release-date" content="The date the item was available on the market">
<meta property="dg:item-added-to-catalogue-date" content="The date the item was added to your inventory">
<meta property="dg:item-feature" content="Abitrary key-value pair that you can use to specify features of the item. For instance colour=blue or
                                          width=30cm or screensize=5.4inch. Darwin & Goliath may use that information to identify related items. ">
<meta property="dg:item-image-2-url" content="The URL of your second image">
<meta property="dg:item-image-2-dimensions" content="In pixels width x height like 300 x 400">
<meta property="dg:item-image-2-caption" content="A description of the image">
<meta property="dg:item-image-i-url" content="The URL of your i-th image">
<meta property="dg:item-image-i-dimensions" content="In pixels width x height like 300 x 400">
<meta property="dg:item-image-i-caption" content="A description of the image">
<meta property="dg:shopping-cart-original-id" content="Your shopping cart id of the current user">
<meta property="dg:item-in-stock" content="0 if not in stock, 1 if in stock (Boolean)">
<meta property="dg:item-manufacturer-or-brand" content="Name of the Manufacturer or Brand">
<meta property="dg:item-price-in-eur content="The price in Euro. The decimal point and thousand seperator can be either ',' or '.'">
<meta property="dg:item-price-in-usd content="The price in US Dollars. The decimal point and thousand seperator can be either ',' or '.'">
<meta property="dg:app-language" content="The language of your website in ISO - 2 or 3 letters">
<meta property="dg:app-version" content="If you want us to log a version number of your website, feel free to provide this number here as string.">

 

Darwin & Goliath will crawl this data from your webpage automatically. As such, the metadata should be embedded in your HTML code (e.g. at http://my-company.com/products/id/12234/).