---
updatedAt: 2025-10-30T22:22:20.000Z
agentTools:
  projectIndex: https://docs.rejoiner.com/llms.txt
---

# trackProductView

This endpoint is used to track product views. It also updates Rejoiner's information about a product on your site.

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th style={{ textAlign: "left" }}>
        Param Name
      </th>

      <th style={{ textAlign: "left" }}>
        Required
      </th>

      <th style={{ textAlign: "left" }}>
        Type
      </th>

      <th style={{ textAlign: "left" }}>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td style={{ textAlign: "left" }}>
        `product_id`
      </td>

      <td style={{ textAlign: "left" }}>
        Yes
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        A unique identifier of the product (e.g. a SKU)
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `name`
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        The name of the product
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `category`
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>

      <td style={{ textAlign: "left" }}>
        Array(String)
      </td>

      <td style={{ textAlign: "left" }}>
        An array of categories the product belongs to
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `price`
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>

      <td style={{ textAlign: "left" }}>
        Integer
      </td>

      <td style={{ textAlign: "left" }}>
        The price of a product *in cents*
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `image_url`
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        The URL of an image or thumbnail of the product
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `product_url`
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        The URL of the product page on your site
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `stock`
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>

      <td style={{ textAlign: "left" }}>
        Integer
      </td>

      <td style={{ textAlign: "left" }}>
        The current stock value of the product
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `expiration_date`
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>

      <td style={{ textAlign: "left" }}>
        Date String
      </td>

      <td style={{ textAlign: "left" }}>
        A string representing the date on which the product expires
      </td>
    </tr>
  </tbody>
</Table>

> 🚧 Important Note
>
> The `expiration_date` field is stored as a proper datetime and is simply used for audience segmenting and display purposes.

> 📘 Any additional params will be treated as strings and added to the `metadata` field of the product.