---
schema_version: "1"
id: 15fe961386744476772cfd0873f9d1fa9df39bab0b808a3fbc566590b90e1066
title: Get Code Details in Einstein Recommendations
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/mc_pb_get_code_details.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.mc_pb_get_code_details.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 1db6f5805df9934e27f3f607b1a3c2a04f8bd306cfa96dcf6dc20c9a0a333b0b
description: Find the JavaScript and HTML code required to render Einstein Recommendations on your page. Copy the code and embed it in your page source for each piece of code.
products:
  - Marketing
  - Marketing Cloud Intelligence
release: "264"
---
# Get Code Details in Einstein Recommendations

Find the JavaScript and HTML code required to render Einstein Recommendations on your page. Copy the code and embed it in your page source for each piece of code.

Customize the provided basic recommendation calls to match your site. The description key in each box shows additional information that you can pass in the JavaScript source URL.

These client parameters aren’t run-time variables. The variables after “?” are supplied in the call at run time.

There are required fields for some pages.

 
| Page | Required Field |
| --- | --- |
| Product Detail | ProductCode |
| Category | CategoryName |
| Cart | List of cart ProductCodes |
| Search | Search Term |

![Home Page](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_data_management_and_analytics-264-0-0-production-enus/7988f60d-cd94-4b42-8836-dc11773564b5/images/icon_example.png)

Home Page

Place the div where it’s displayed in the recommendation. Place this value exactly where it appears on the page.

`<div id="igdrec_1"></div>`.

Next, place a script tag with this code.

`<script src="http://{client_name}.recs.igodigital.com/a/v2/{client}/home/recommend.js"></script>`

![Product Detail Page](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_data_management_and_analytics-264-0-0-production-enus/7988f60d-cd94-4b42-8836-dc11773564b5/images/icon_example.png)

Product Detail Page

Place the div where it’s displayed in the recommendation. Place this value exactly where it appears on the page.

`<div id="igdrec_1"></div>`.

Next, place a script tag with this code.

```
<script src="http://{client_name}.recs.igodigital.com/a/v2/{client}/product/recommend.js?item=ProductCode"></script>..
```

ProductCode is the item viewed and must match the same value passed in the Collect Tracking Code `item` variable.

![Category and Sub-Category Page](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_data_management_and_analytics-264-0-0-production-enus/7988f60d-cd94-4b42-8836-dc11773564b5/images/icon_example.png)

Category and Sub-Category Page

Place the div where the recommendation displays. Place this value exactly where it appears on the page.

`<div id="igdrec_1"></div>`.

Next, place a script tag with this code.

`<script src="http://{client_name}.recs.igodigital.com/a/v2/{client}/category/recommend.js? category=Category_name"></script>`.

Replace Category with the actual category page name where the recommendation call is being made. This code must exactly match the categories stored in the product catalog category.

If the category name includes any spaces or special characters, the URL value must be encoded. For example, if the category is _Category & Name_, then the URL parameter is `category=Category%20%26%20Name`.

![Shopping Cart Review Page](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_data_management_and_analytics-264-0-0-production-enus/7988f60d-cd94-4b42-8836-dc11773564b5/images/icon_example.png)

Shopping Cart Review Page

Place the div where the recommendation displays. Place this value exactly where it appears on the page.

`<div id="igdrec_1"></div>`.

Place a script tag with this code after the div.

`<script src="https://{client_name}.recs.igodigital.com/a/{client}/cart/recommend.js?cart=ProductCode".</script>`.

Match the value in ProductCode to the value sent in the Collect Tracking Code `cart` variable as a pipe-delimited list.