> ## Documentation Index
> Fetch the complete documentation index at: https://developers.criteo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OneTag for Retail Media Offsite

# Introduction

<Info>
  **What is OneTag?**

  The Criteo OneTag is a code snippet to embed in your website's source code or tag management system. It measures and analyzes user interactions on your site. It also loads asynchronously, ensuring no impact on site performance or customer experience.
</Info>

***

# Integration Flow

The diagram below illustrates the integration flow for OneTag Offsite. The process has three main phases: preparation (mostly on Criteo's side), technical integration (involving both parties) and the "Go live", which is the campaign's activation.

<Frame>
  <img src="https://mintcdn.com/criteo-e1682996/PtO-HGDADAVLvs2M/images/retailer-integration/docs/808fa5757a744f229eb4cd9ac0aa60e371dc421f0f148ed71f08f88d5e5efb3e-Copy_of_Criteo_RM_Integration_timeline_1.png?fit=max&auto=format&n=PtO-HGDADAVLvs2M&q=85&s=c1d59d154ed40b6531e031e058a19855" alt="808fa5757a744f229eb4cd9ac0aa60e371dc421f0f148ed71f08f88d5e5efb3e Copy_of_Criteo_RM_Integration_timeline_1" width="1920" height="1080" data-path="images/retailer-integration/docs/808fa5757a744f229eb4cd9ac0aa60e371dc421f0f148ed71f08f88d5e5efb3e-Copy_of_Criteo_RM_Integration_timeline_1.png" />
</Frame>

***

# Common Parameters

There are some common parameters which are shared between all the tags:

<table>
  <thead>
    <tr>
      <th>
        <p>
          Event
        </p>
      </th>

      <th>
        <p>
          Key
        </p>
      </th>

      <th>
        <p>
          Example value
        </p>
      </th>

      <th>
        <p>
          Description
        </p>
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <p>
          <code>
            setAccount
          </code>
        </p>
      </td>

      <td>
        <p>
          account
        </p>
      </td>

      <td>
        <p>
          <code>
            12345
          </code>
        </p>
      </td>

      <td>
        <p>
          Your Criteo Account or Partner ID, provided by your technical contact, to route data to Criteo servers.
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            setRetailerVisitorId
          </code>
        </p>
      </td>

      <td>
        <p>
          id
        </p>
      </td>

      <td>
        <p>
          <code>
            0193553C0A39937F23FC
          </code>
        </p>
      </td>

      <td>
        <p>
          A unique, unauthenticated user ID valid for at least 30 days. Used to track visitor behavior across sessions. Typically retrieved via a first-party cookie.
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            setCustomerId
          </code>
        </p>
      </td>

      <td>
        <p>
          id
        </p>
      </td>

      <td>
        <p>
          <code>
            1SDFJI435FH12HFK2
          </code>
        </p>
      </td>

      <td>
        <p>
          A consistent, internal ID for logged-in users, linked to accounts, purchase history, or membership programs.
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            setEmail
          </code>
        </p>
      </td>

      <td>
        <p>
          email
        </p>
      </td>

      <td>
        <p>
          <code>
            d9c37700(...)18be88
          </code>
        </p>
      </td>

      <td>
        <p>
          User’s email address in SHA256 hash format. *Please pass an empty string if the user's email is unavailable.*
        </p>
      </td>
    </tr>
  </tbody>
</table>

***

# Tags

## Dynamic Loader

To load the Criteo JavaScript library and ensure the loader is included across all pages, make sure to insert the following script in the `head` of your site. Also don't forget to replace the placeholder with your unique Criteo `Partner ID`:

```javascript theme={null}
<!-- Criteo Loader File -->
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=#####" async></script>
<!-- END Criteo Loader File -->
```

***

## Homepage Tag

Trigger this tag on the homepage ([http://www.retailer.com](http://www.retailer.com)). Substitute all placeholders with actual values.

```javascript theme={null}
<!-- Criteo Loader File -->
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=#####" async></script>
<!-- END Criteo Loader File -->

<!-- Criteo Homepage Tag -->
<script type="text/javascript">
    window.criteo_q = window.criteo_q || [];
    window.criteo_q.push(
        { event: "setAccount", account: "12345" }, // Your partner ID
        { event: "setEmail", email: "d9c378bb0369ee148f7700fc296165d4e8dc356b90ac318be3701ee76f00c588", hash_method: "sha256" }, // User's SHA-256 hashed email
        { event: "setCustomerId", id: "1SDFJI435FH12HFK2" }, // User's logged-in ID
        { event: "setRetailerVisitorId", id: "0193553C0A39937F23FC" }, // User's guest ID
        { event: "viewHome" }
    );
</script>
<!-- END Criteo Homepage Tag -->
```

***

## Listing Tag

Trigger this tag on all category pages (e.g., [https://www.retailer.com/shopping/men](https://www.retailer.com/shopping/men)) or search result pages. Substitute all placeholders with actual values.

```javascript theme={null}
<!-- Criteo Loader File -->
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=#####" async></script>
<!-- END Criteo Loader File -->

<!-- Criteo Listing Tag -->
<script type="text/javascript">
    window.criteo_q = window.criteo_q || [];
    window.criteo_q.push(
        { event: "setAccount", account: "12345" }, // Your partner ID
        { event: "setEmail", email: "d9c378bb0369ee148f7700fc296165d4e8dc356b90ac318be3701ee76f00c588", hash_method: "sha256" }, // User's SHA-256 hashed email
        { event: "setCustomerId", id: "1SDFJI435FH12HFK2" }, // User's logged-in ID
        { event: "setRetailerVisitorId", id: "0193553C0A39937F23FC" }, // User's guest ID
        { 
            event: "viewList", 
            item: [
                "123", // First item ID
                "456", // Second item ID
                "789"  // Third item ID
            ] 
        }
    );
</script>
<!-- END Criteo Listing Tag -->
```

***

## Product Tag

Use this tag on product pages (e.g., [https://www.retailer.com/shopping/product-jacket-123456](https://www.retailer.com/shopping/product-jacket-123456)). Substitute all placeholders with actual values. For availability, insert boolean value `0` for out of stock, `1` for in stock.

```javascript theme={null}
<!-- Criteo Loader File -->
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=#####" async></script>
<!-- END Criteo Loader File -->

<!-- Criteo Product Tag -->
<script type="text/javascript">
    window.criteo_q = window.criteo_q || [];
    window.criteo_q.push(
        { event: "setAccount", account: "12345" }, // Your partner ID
        { event: "setEmail", email: "d9c378bb0369ee148f7700fc296165d4e8dc356b90ac318be3701ee76f00c588", hash_method: "sha256" }, // User's SHA-256 hashed email
        { event: "setCustomerId", id: "1SDFJI435FH12HFK2" }, // User's logged-in ID
        { event: "setRetailerVisitorId", id: "0193553C0A39937F23FC" }, // User's guest ID
        { event: "viewItem", item: "ABC123", price: 19.99, availability: 1 } // Product ID for the viewed item
    );
</script>
<!-- END Criteo Product Tag -->
```

***

## Add-to-Cart Tag

Trigger this tag when an item is added to the cart. Substitute all placeholders with actual values.

```javascript theme={null}
<!-- Criteo Loader File -->
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=#####" async></script>
<!-- END Criteo Loader File -->

<!-- Criteo Add-to-cart Tag -->
<script type="text/javascript">
    window.criteo_q = window.criteo_q || [];
    window.criteo_q.push(
        { event: "setAccount", account: "12345" }, // Your partner ID
        { event: "setEmail", email: "d9c378bb0369ee148f7700fc296165d4e8dc356b90ac318be3701ee76f00c588", hash_method: "sha256" }, // User's SHA-256 hashed email
        { event: "setCustomerId", id: "1SDFJI435FH12HFK2" }, // User's logged-in ID
        { event: "setRetailerVisitorId", id: "0193553C0A39937F23FC" }, // User's guest ID
        { 
            event: "addToCart", 
            item: [
                {
                    id: "ABC123", // Product ID
                    price: "49.99", // Product price
                    quantity: "2" // Quantity added to the cart
                }
            ]
        }
    );
</script>
<!-- END Criteo Add-to-cart Tag -->
```

***

## Basket Tag

Use this tag on the basket page ([https://www.retailer.com/basket](https://www.retailer.com/basket)). Substitute all placeholders with actual values, ensuring prices are the **singular unitary price** of each item.

```javascript expandable theme={null}
<!-- Criteo Loader File -->
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=#####" async></script>
<!-- END Criteo Loader File -->

<!-- Criteo Basket / Cart Tag -->
<script type="text/javascript">
    window.criteo_q = window.criteo_q || [];
    window.criteo_q.push(
        { event: "setAccount", account: "12345" }, // Your partner ID
        { event: "setEmail", email: "d9c378bb0369ee148f7700fc296165d4e8dc356b90ac318be3701ee76f00c588", hash_method: "sha256" }, // User's SHA-256 hashed email
        { event: "setCustomerId", id: "1SDFJI435FH12HFK2" }, // User's logged-in ID
        { event: "setRetailerVisitorId", id: "0193553C0A39937F23FC" }, // User's guest ID
        { 
            event: "viewBasket", 
            item: [
                {
                    id: "ABC123", // Product ID
                    price: "49.99", // Product price
                    quantity: "2" // Quantity in the basket
                },
                {
                    id: "XYZ789", // Product ID for another item
                    price: "19.99", // Product price
                    quantity: "1" // Quantity in the basket
                }
                // Add a new object for each additional item in the cart
            ]
        }
    );
</script>
<!-- END Criteo Basket / Cart Tag -->
```

***

## Conversion Tag

Trigger this tag on the "Thank You" page post-purchase. Substitute all placeholders with actual values, ensuring prices are the **singular unitary price** of each item.

```javascript expandable theme={null}
<!-- Criteo Loader File -->
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=#####" async></script>
<!-- END Criteo Loader File -->

<!-- Criteo Conversion Tag -->
<script type="text/javascript">
    window.criteo_q = window.criteo_q || [];
    window.criteo_q.push(
        { event: "setAccount", account: "12345" }, // Your partner ID
        { event: "setEmail", email: "d9c378bb0369ee148f7700fc296165d4e8dc356b90ac318be3701ee76f00c588", hash_method: "sha256" }, // User's SHA-256 hashed email
        { event: "setCustomerId", id: "1SDFJI435FH12HFK2" }, // User's logged-in ID
        { event: "setRetailerVisitorId", id: "0193553C0A39937F23FC" }, // User's guest ID
        { 
            event: "trackTransaction", 
            id: "TRX12345", // Transaction ID
            item: [
                {
                    id: "ABC123", // Product ID
                    price: "49.99", // Product price
                    quantity: "2" // Quantity purchased
                },
                {
                    id: "XYZ789", // Product ID for another item
                    price: "19.99", // Product price
                    quantity: "1" // Quantity purchased
                }
                // Add a new object for each additional purchased item
            ]
        }
    );
</script> 
<!-- END Criteo Conversion Tag -->
```

***

<br />
