---
title: addProductDetails
slug: js-api/addproductdetails
description: Overview of the Monetate JavaScript API addProductDetails method and how to use it
image:  https://archbee-image-uploads.s3.amazonaws.com/ceIfEvQHzQk1IVxoRWUh7/K9eTL4jKm7UQINb6zNziJ-20250912-181225.png
docTags: 
createdAt: 2024-04-30T17:02:47.411Z
---

:::CodeblockTabs
addProductDetails Method

```javascript
// addProductDetails Method
window.monetateQ.push([
  "addProductDetails", ["pidString", "pidString", "pidString"]
]);
```
:::

Use the `addProductDetails` method to add items when a customer views a more detailed product description on a product detail page. This type of page is usually linked from an index or search page thumbnail. Some product detail pages may have several items described.

:::hint{type="info"}
A product ID (PID) can have a maximum of 50 characters. Any PID that exceeds this length is truncated after 50 characters.
:::

## Monetate Inspector View

This screenshot shows the **Components** tab of the [Monetate Inspector browser plug-in](https://docs.monetate.com/docs/install-the-monetate-inspector-browser-plug-in). The Products row indicates that the `addProductDetails` method has passed PID values as well as product SKU values.

:::hint{type="info"}
Although both PID and SKU are required in a [product catalog](https://docs.monetate.com/docs/product-catalog-specification#required-attributes), you're only required to implement method calls for PID. You should implement SKU if you intend to use [Product Recommendations](https://docs.monetate.com/docs/recommendations-overview#implementation-requirements) or target by SKU.

Older deployments may require a script update to add SKU support for the method. Contact your Services team for more information.
:::

![The Components tab of Monetate Inspector, with product in the Page Type row and both product IDs and product SKUs in the Products row](https://dyzz9obi78pm5.cloudfront.net/app/image/id/64f7771c3f0b6a33c820ddc5/n/monetate-inspector-components-tab-event-viewproduct-viewpage-page-type-product-products-row.png)

## Code Examples

:::CodeblockTabs
addProductDetails Example

```javascript
// addProductDetails Example
window.monetateQ = window.monetateQ || [];
window.monetateQ.push([
  "addProductDetails", ["a123"]
]);
window.monetateQ.push([
  "trackData"
]);
```

Single SKU Example

```javascript
window.monetateQ = window.monetateQ || [];
window.monetateQ.push([
  "addProductDetails", [{
    productId: "pidString",
    sku: "skuString"
  }]
]);
window.monetateQ.push([
  "trackData"
]);
```

Multiple SKUs Example

```javascript
window.monetateQ = window.monetateQ || [];
window.monetateQ.push([
  "addProductDetails", [
  {
    productId: "pidString",
    sku: "skuString_01"
  },
  {
    productId: "pidString",
    sku: "skuString_02"
  },
  {
    productId: "pidString",
    sku: "skuString_03"
  }]
]);
window.monetateQ.push([
  "trackData"
]);
```
:::

