> For the complete documentation index, see [llms.txt](https://help.citrusad.com/retail-media-interface/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.citrusad.com/retail-media-interface/integration/it/feature-integrations/pagination.md).

# Paginazione

<figure><img src="/files/HXNu9cZu4K2sbyATcgOs" alt="" width="100%"><figcaption></figcaption></figure>

Migliora l'esperienza del cliente durante la navigazione su più pagine. Quando generi annunci di prodotto, riceverai un `memoryToken` che può essere inviato nelle richieste successive per escludere gli annunci già erogati in precedenza.

{% hint style="warning" %}
Solo per annunci di prodotto!

Questa funzionalità è attualmente supportata solo per Epsilon Retail Mediagli annunci di prodotto di.
{% endhint %}

## Come implementare la paginazione sul tuo sito?

Quando generi annunci di prodotto, nella risposta riceverai un `memoryToken`.

```http
{
    "ads": [
        {
            "id": "display_3rGiryPskhQusmsf43nghbQwnqo3NzMzNjU3",
            "gtin": "7733657",
            "discount": {
                "amount": 0,
                "minPrice": 0,
                "maxPerCustomer": 0
            },
            "expiry": "2021-05-12T04:17:50.400917769Z",
            "position": 1
        }
    ],
    "banners": [],
    "products": [],
    "memoryToken":"85ykKVv-luDHMWLZx2d6xcPq6sF7CgkJCSJDb3VudGVyIjogIjIiLAoJCQkiQWRzIjogWwoJCQkJImRpc3BsYXlfV05VV0NwQkRKMUpKNm5wdVZSVExvOU40TUxzNE1UWTBOemt5TWc9PSIsCgkJCQkiZGlzcGxheV9MME5NUHRxNmdCcVFvREJOd3J0dE9UTGJoWk0xTVRFeU9UYzRPUT09IiwKCQkJCSJkaXNwbGF5XzlCcEpmdUpaWk9VXzgyaWpFM3VCczgxd3VVczRNekkwTnpVeE5nPT0iLAoJCQkJImRpc3BsYXlfcW1VU1p4TkpMQ0lqeWQwdTFJRDk0RmxVZ0pnNE16STBOelV4Tnc9PSIsCgkJCQkiZGlzcGxheV9oeHlFZktCUnRrNWlxMThMQzE1SDJHcEN3QjgxTVRFeU9UYzVNQT09IiwKCQkJCSJkaXNwbGF5X1NkcjFEcU5aUEFtcGh0Q1FIUndoYUxFT1B0RXhNamsxT1RJNE5BPT0iLAoJCQkJImRpc3BsYXlfeVlSai1qV2Ntc2ozNzhrel9PMm0yOVlwTjhJeE5EazNPRE00TXc9PSIsCgkJCQkiZGlzcGxheV9Xbm9NZGZuLTRTVmhxcF9xQzVvLWxoT0paNm8xTkRJeE1UUTROdz09IgoJCQldLAoJCQkiVFRMIjogMTYyODk4NTYwMAoJCX0="
}
```

Quando un cliente passa alla pagina successiva, dovresti inviare questo token nella tua richiesta di annunci successiva.

```http
POST $BASE_URL/v1/ads/generate HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
    "customerId": "wertg5432a",
    "sessionId": "ec9-4e07-881d-3e9",
    "placement": "search",
    "catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
    "searchTerm": "chocolate",
    "memoryToken":"85ykKVv-luDHMWLZx2d6xcPq6sF7CgkJCSJDb3VudGVyIjogIjIiLAoJCQkiQWRzIjogWwoJCQkJImRpc3BsYXlfV05VV0NwQkRKMUpKNm5wdVZSVExvOU40TUxzNE1UWTBOemt5TWc9PSIsCgkJCQkiZGlzcGxheV9MME5NUHRxNmdCcVFvREJOd3J0dE9UTGJoWk0xTVRFeU9UYzRPUT09IiwKCQkJCSJkaXNwbGF5XzlCcEpmdUpaWk9VXzgyaWpFM3VCczgxd3VVczRNekkwTnpVeE5nPT0iLAoJCQkJImRpc3BsYXlfcW1VU1p4TkpMQ0lqeWQwdTFJRDk0RmxVZ0pnNE16STBOelV4Tnc9PSIsCgkJCQkiZGlzcGxheV9oeHlFZktCUnRrNWlxMThMQzE1SDJHcEN3QjgxTVRFeU9UYzVNQT09IiwKCQkJCSJkaXNwbGF5X1NkcjFEcU5aUEFtcGh0Q1FIUndoYUxFT1B0RXhNamsxT1RJNE5BPT0iLAoJCQkJImRpc3BsYXlfeVlSai1qV2Ntc2ozNzhrel9PMm0yOVlwTjhJeE5EazNPRE00TXc9PSIsCgkJCQkiZGlzcGxheV9Xbm9NZGZuLTRTVmhxcF9xQzVvLWxoT0paNm8xTkRJeE1UUTROdz09IgoJCQldLAoJCQkiVFRMIjogMTYyODk4NTYwMAoJCX0=",
    "options": {
                         "filterMode": "AndOr"
                             },
    "maxNumberOfAds": 3
}

```

Utilizzando questo token, Epsilon Retail Media escluderà qualsiasi annuncio precedentemente erogato al cliente se i **sessionId** sono identici a quelli della richiesta del token.

{% hint style="warning" %}
Integrazione standard!

Questa funzionalità è attualmente supportata solo per Epsilon Retail Mediagli annunci di prodotto di.
{% endhint %}

## Come funziona?

Quando Epsilon Retail Media riceve un `memoryToken` nella richiesta di annunci, tutti gli annunci precedentemente erogati per il **sessionId** saranno esclusi dalla risposta dell'annuncio. Ciò garantisce una maggiore varietà di annunci erogati al tuo cliente in un percorso su più pagine.

Quando questo token non è presente nella richiesta, la generazione degli annunci avverrà secondo il processo attuale senza applicare alcuna esclusione. Un token verrà sempre fornito dopo la generazione dell'annuncio affinché il retailer possa scegliere di utilizzarlo.

Il token di memoria contiene informazioni codificate che consentono a Epsilon Retail Media di determinare gli annunci che sono stati erogati in precedenza (sia in una singola richiesta, sia nell'arco di più richieste collegate tra loro).

Nel caso in cui venga inviato un token non pertinente a Epsilon Retail Media (ad esempio un contesto diverso), gli annunci vengono restituiti come se non fosse stato fornito alcun token nella richiesta di annunci.

{% hint style="warning" %}
️ Richiedi più annunci di quelli erogati sul tuo sito web?

Se sei un retailer che richiede più annunci a Epsilon Retail Media di quanti ne vengano effettivamente erogati al tuo cliente, potresti non ricevere molti annunci nelle pagine successive. Se richiedi 15 annunci e ne eroghi solo 4 al tuo cliente, quando si riceve il `memoryToken`, Epsilon Retail Media escluderà tutti i 15-20 annunci erogati in precedenza nella risposta di annunci successiva.
{% endhint %}

### Flusso di richiesta di esempio

<figure><img src="/files/mS5tNxoZl8KkL4dYWSle" alt="" width="100%"><figcaption></figcaption></figure>

## Domande frequenti

**Posso utilizzare questo token su più ricerche del cliente per escludere i prodotti nel percorso cliente più ampio?**

No, se Epsilon Retail Media riceve una richiesta di annunci che non corrisponde alla richiesta di annunci del token, questa viene ignorata e gli annunci vengono generati come se non fosse stato fornito alcun token.

**Cosa succede se invio un memoryToken ed è malformato?**

Epsilon Retail Media ignorerà il token ed elaborerà la richiesta come se fosse una normale richiesta.

**Per quante pagine posso effettuare la paginazione?**

Per impostazione predefinita il valore è 5, rappresenta il miglior equilibrio tra prestazioni e saturazione che Epsilon Retail Media ha riscontrato su più clienti.

A partire dalla Epsilon Retail Mediarelease 39.0 di, questo valore può essere configurato tramite il tuo Technical Account Manager.

**Cosa succede quando si esauriscono gli annunci da erogare, ad esempio nelle pagine 5-10 nella configurazione predefinita?**

Il memoryToken è configurato lato Epsilon Retail Mediaper memorizzare gli annunci del numero di pagine previsto nella configurazione. Ad esempio, se la configurazione è quella predefinita di 5 pagine, Epsilon Retail Media ricomincerà a erogare annunci a partire dalla pagina 7.

Richiesta di paginazione 6 (pagina 6): il memoryToken contiene informazioni sugli annunci delle 5 pagine precedenti, pertanto non verrà erogato alcun annuncio delle 5 pagine precedenti.

Richiesta di paginazione 7 (pagina 7): gli annunci della pagina 1 sono idonei per essere erogati.

**Cosa succede se esaurisco gli annunci prima della pagina 5 nella configurazione predefinita?**

Se ad esempio entro la pagina 3 esaurisci gli annunci, ricominceremo a erogare annunci entro la pagina 7, poiché memorizziamo il numero totale di pagine nella configurazione come annunci erogati in precedenza che non dovrebbero essere erogati di nuovo.


---

# 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://help.citrusad.com/retail-media-interface/integration/it/feature-integrations/pagination.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.
