> For the complete documentation index, see [llms.txt](https://docs.antsomi.com/cdp-365-user-guide-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.antsomi.com/cdp-365-user-guide-en/use-cases/marketing-hub/how-to-recommend-products-using-the-parent-child-algorithm.md).

# How to recommend products using the Parent-Child Algorithm

If you're seeking a solution to eliminate duplicated product recommendations within the same category, this document can provide valuable assistance.

## Why does it happen?

When utilizing algorithms to recommend products **based on customer interactions** such as viewing products or adding them to the cart, the recommendations include products **without considering** specific attributes like **size or color** that the customers may have interacted with.

This situation can result in an experience that seems generic and potentially frustrating for your customers.

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2Fd2Eikj4VMmMyRaYIOLXZ%2Fimage.png?alt=media&amp;token=0c0ae31e-2e17-4e7a-bff1-60d3a1d75d7a" alt=""><figcaption><p>Duplication of the recommended products</p></figcaption></figure>

## How to solve it?

CDP 365 offers a feature that enables you to provide **product recommendations based on either Parent or Child data**.

This feature limits the recommended products to **either parent or child items exclusively**, and it removes any instances of duplicated parent and child products.

To differentiate between Parent and Child data, please navigate to the [Parent and Child data ](#parent-and-child-data)section.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd-uSRheMWKJFC4VRaxj8DkdNp_eJ5UX0OQ6aw26RBfuu--Ywzy37FvMU8jx-ssGZAOONt8G4Dim83yxt1AFYY4kMey1DhImEv8K1sYHH8-f9uqdYd1Y73CfNx7U9r21PJQsAWLAxlPo5tDsRHNY3vZoTHw?key=jqlrLHcQRq84j2mU-bHqrw" alt=""><figcaption></figcaption></figure>

### Parent and Child data

Within CDP 365, we have labeled the **child products** using the **existing** values of the **Parent Item ID** attribute. If the Parent Item ID attribute has **non-existing values**, then those values correspond to the **parent products**.

Therefore, kindly proceed to your **Product** Business Object and access the attribute to view its associated data.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeBwgX88OE4wf4DfNtWbceaBNDHTETOKZ-tzi3Z4QHiH8-JGQUD2PXUcOWZuwco-fe8LUxWCXqZwtRd06Rv2-AS_6PWxpMDGPtXy8To3T-Hl5Re4UiJuC3_TPO22BluLsdvwIYIf16K-37-adeDtSbI-Ac?key=jqlrLHcQRq84j2mU-bHqrw" alt=""><figcaption></figcaption></figure>

Once you identify whether a product is categorized as a child or parent, you can then **determine which product level** to recommend to your audience.

* **Step 1**: Go to the settings of the **Product Business Object**.&#x20;
* **Step 2**: Activate the **Parent-Child relationship** feature, enabling you to recommend products based on different product levels.&#x20;
* **Step 3**: Choose and configure the specific levels that you want to enable in the template settings.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeoJ64PS9hYJuM1VdZgW_PuFKznIhH4yeFzcBQIXQ0eXR9Gqswptw8qb6SilNGf22yA_PZjtFXbo_QbFE1v3v0fPnjUn67tG3cLrpCsTFi2mJqB2Iuqkob5EHNreQ-fFuMAaQp3lnuryNJEc-zn1CiDvIKY?key=jqlrLHcQRq84j2mU-bHqrw" alt=""><figcaption></figcaption></figure>

You have the choice of three levels:

1. **Parent**
2. **Child**
3. **Parent and Child**

Depending on your selection, the relevant product level will become available for you to choose in the template settings.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcstz_yv685wceToUq_GJja4HX7f856efxLhV7-D8RMPsBYwYxGVbBFTEpmOAELBltpgNsG9TnEWgkL0gh2Uzt0HTEugto6walt_GcIJOd_14lXBlA8AbvnGpSZU3g5nayYI2MrJwt-VIivEnxLqjQoopQ?key=jqlrLHcQRq84j2mU-bHqrw" alt=""><figcaption></figcaption></figure>

### In your template

In your template, you can now **opt for the specific product level** to which you want to recommend products.

Here's how to do it:

* **Step 1**: Access the general **Settings** and proceed to the **Basic** tab.&#x20;
* **Step 2**: Within the **Content Sources** section.&#x20;
* **Step 3**: Choose the **Product source**&#x20;
* **Step 4**: Confirm your selection to complete the process.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfxgs-Fi787lk1-wi3IaVtlbMQJjo7nGGlMrG6kQO1sSnlz7u2AcP77SHOm8vffAWfEz3Bf1m5yubG8tExWHHsHVETBVki9mNGMm02c7-K95B3cLV4Cqqr3qg30IOeb0FpAn0N4KtMXakVWX86ephdDDxU?key=jqlrLHcQRq84j2mU-bHqrw" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.antsomi.com/cdp-365-user-guide-en/use-cases/marketing-hub/how-to-recommend-products-using-the-parent-child-algorithm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
