---
title: 'Criteo OneTag 고급 설정'
description: '고급 설정을 활성화하려면 Criteo OneTag의 수정이 필요합니다. 크로스 디바이스 타겟팅, 다수 지역/통화를 사용하는 광고주 등 다양한 주제가 포함됩니다. 각 상황에 맞는 설정 방법은 아래 예시를 참고하십시오.'
language: ko
guide: M2TiX6m90K
updated: 2025-11-12T13:21:16Z
canonical: https://help.criteo.com/kb/guide/ko/criteo-onetag-M2TiX6m90K/Steps/886908
alternates:
  de: https://help.criteo.com/kb/guide/de/erweiterte-einstellungen-von-criteo-onetag-M2TiX6m90K.md
  en: https://help.criteo.com/kb/guide/en/criteo-onetag-advanced-settings-M2TiX6m90K.md
  es: https://help.criteo.com/kb/guide/es/configuracion-avanzada-de-criteo-onetag-M2TiX6m90K.md
  fr: https://help.criteo.com/kb/guide/fr/parametres-avances-de-criteo-onetag-M2TiX6m90K.md
  it: https://help.criteo.com/kb/guide/it/impostazioni-avanzate-di-criteo-onetag-M2TiX6m90K.md
  ja: https://help.criteo.com/kb/guide/ja/criteo-tag-M2TiX6m90K.md
  pt: https://help.criteo.com/kb/guide/pt/configuracoes-avancadas-da-criteo-onetag-M2TiX6m90K.md
  zh: https://help.criteo.com/kb/guide/zh/criteo-onetag-M2TiX6m90K.md
---

> Index of this knowledge base: https://help.criteo.com/llms.txt
>
> Interactive version: https://help.criteo.com/kb/guide/ko/criteo-onetag-M2TiX6m90K/Steps/886908

# Criteo OneTag 고급 설정

<a id="step-886908"></a>

## Criteo OneTag 고급 설정

고급 설정을 활성화하려면 Criteo OneTag의 수정이 필요합니다.  

  
크로스 디바이스 타겟팅, 다수 지역/통화를 사용하는 광고주 등 다양한 주제가 포함됩니다. 각 상황에 맞는 설정 방법은 아래 예시를 참고하십시오.

- If "크로스 디바이스 이벤트 설정": [Cross-Device Event를 통해 해시된 이메일 전달](#step-887075)
- If "Pass phone numbers with OneTag": [Pass phone numbers with OneTag](#step-4106561)
- If "다양한 사이트 유형을 사용하는 경우의 이벤트 설정": [다양한 사이트 유형을 사용하는 경우의 이벤트 설정](#step-887074)
- If "다수 국가에서 운영하는 경우의 이벤트 설정": [다수 국가에서 운영하는 경우의 이벤트 설정](#step-887076)
- If "여러 통화를 사용하는 경우의 이벤트 설정": [여러 통화를 사용하는 경우의 이벤트 설정](#step-887079)
- If "동일한 장바구니를 사용하는 다수의 웹사이트를 위한 이벤트 설정": [동일한 장바구니를 사용하는 다수의 웹사이트를 위한 이벤트 설정](#step-887071)
- If "다양한 결재 방식을 위한 이벤트 설정": [다양한 결재 방식을 위한 이벤트 설정](#step-887073)
- If "여행업계 광고주를 위한 이벤트 설정": [여행업계 광고주를 위한 이벤트 설정](#step-887078)
- If "검색 목록 페이지의 Criteo OneTag로 전달되는 상품 ID가 3개 미만/이상인 경우": [검색 목록 페이지의 Criteo OneTag로 전달되는 상품 ID가 3개 미만/이상인 경우](#step-887077)
- If "netID 통합 설정": [netID 통합 설정](#step-887072)

<a id="step-887075"></a>

## Cross-Device Event를 통해 해시된 이메일 전달

Criteo OneTag 내에서 교차 기기 매개변수를 구현하는 것은 다음과 같은 경우에 필수적입니다.

-   지금 Safari 및 Firefox에서 접근 가능한 잠재고객에게 도달하고 Chrome에서 타사 쿠키 사용 중단을 준비합니다.
    
-   교차 장치 기능 활성화: 잠재 고객이 모바일 장치에서 웹사이트의 제품을 탐색하는 경우 이 매개변수를 사용하면 나중에 이 고객에게 데스크톱 장치에 관련 광고를 표시할 수 있습니다.
    
-   Commerce Growth에 연락처 목록을 업로드하거나 API를 통해 보낼 때 일치율을 개선합니다.
    

**작동 방식**

교차 기기 매개변수는 방문자의 해시된 이메일 주소를 웹사이트로 전달할 수 있는 작은 코드 스니펫입니다. 모든 이메일 주소는 Criteo 서버에 저장되기 전에 SHA-256 알고리즘을 사용하여 해시됩니다. 그런 다음 Criteo는 해시 값을 사용하여 각 장치의 사용자를 일치시킵니다.  
  
고객의 개인 정보를 보호하기 위해 Criteo는 고객의 해시된 이메일 주소만 당사 서버에 저장합니다.  

**내 웹사이트의 개인정보 보호정책을 업데이트해야 합니까?**

귀하의 웹사이트 개인정보 보호정책은 이메일 주소가 수집되고 캠페인 성과를 최적화하기 위해 협력하는 제3자와 공유될 수 있으며 이 정보가 가장 안전한 최신 SHA256 해싱 기술을 사용하여 해싱된다는 사실을 웹사이트 방문자에게 명확하게 알리도록 해야 합니다.

또한 방문자에게 귀하가 그들의 개인정보를 존중한다는 사실을 알려야 하며 방문자가 이러한 정보를 공유하지 않기를 원하는 경우 웹사이트 사용자 쿠키 준수 배너(CMP)에서 선호하는 옵션을 선택하여 방문자가 공유할 수 있습니다.

자세한 내용은 [Criteo의 개인정보 보호정책](https://help.criteo.com/kb/guide/en/the-criteo-privacy-promise-pDIW4yiawH/Steps/775742) 을 참조하고 웹사이트의 개인정보 보호정책 섹션에 제공된 링크를 포함할 수도 있습니다.

> **Tip:** 법무팀이 개인정보 보호와 관련하여 우려 사항이 있는 경우 필요에 따라 당사 법무팀과 연결해 줄 Criteo 비즈니스 담당자에게 연락할 수 있습니다.

**교차 기기 매개변수를 구현하는 방법**

최대한의 유연성을 제공하기 위해 Criteo는 다음 형식의 사용자 이메일 주소를 허용합니다.

-   **SHA256 해시** (주소 지정 가능한 광고에 대한 업계 표준에 따름).
    
-   **MD5** 또는 **SHA256MD5 해시** (Criteo의 기존 방식).
    
-   **일반 텍스트** (이후 이메일에 SHA256 암호화 사용).
    

> **Tip:** **참고** : Criteo는 MD5/SHA256MD5를 통한 이메일 해싱에서 SHA256으로 마이그레이션 중입니다. 특히 마이그레이션 기간 동안 데이터와 ID 그래프 간의 일치율을 최대화하려면 **기존 형식(MD5 또는 SHA256MD5)을 새로운 SHA256 형식과 함께 공유하십시오** .
>
> 둘 다 공유할 수 없는 경우 **SHA256 형식을 우선적으로 사용** 하세요.
>
> 일반 텍스트를 공유하는 경우 업데이트가 필요하지 않습니다.

교차 기기 매개변수를 구현하는 각 방법에 대한 자세한 내용:

- If "SHA256 및 MD5(선호)": [SHA256 및 MD5(선호)](#step-1948825)
- If "SHA256 해시": [SHA256 해시](#step-1948824)
- If "일반 텍스트": [일반 텍스트](#step-1948817)
- If "MD5 또는 SHA256MD5(레거시)": [MD5 또는 SHA256MD5(레거시)](#step-1950390)
- If "해싱 함수": [해싱 함수](#step-1948827)
- If "자주하는 질문": [자주하는 질문](#step-1948826)

<a id="step-4106561"></a>

## Pass phone numbers with OneTag

Phone numbers, as well as e-mails, are one of the biggest sources of identity information. In order to maximize our identification capabilities, we decided to accept them as well as an user identifier, as in some regions (APAC or US, for example) they are very representative and easier to share than e-mail addresses or other identifiers.

To improve our compatibility with already established standards in the industry, we have decided to enable phone number collection through Criteo's OneTag. Some of the upsides of sharing phone numbers are:

-   HPN (hashed phone number) is the best representation of a **single user and it persists over time**: In general, people have a single persistent phone number whereas they may have several emails, mobile ids or cookies. 
    
-   HPN improves **our 360 vision of the user**: a user has a single phone number, available for each of his devices. It helps us improve our bidding, our recommendation and thus the performance for our clients. 
    
-   HPN **interoperates** with several identifiers including HEM and some alternative ids. We can:
    
    -   Collect HPN <> alternative ids links and bid directly on the alternative ids. 
        
    -   Collect HEM <> HPN and bid directly with the HEM.
        

**How it works**

We collect the data through a small snippet of code that allows you to pass the phone numbers of visitors to your website. Event though they can be collected in plain or hashed formats, all phone numbers will be hashed, using a SHA-256 algorithm, before being stored on Criteo's servers. Criteo will then use the hash value to match users across each of their devices.

To ensure we protect your customers’ privacy, Criteo will only store the hashed phone numbers of your customers on our servers. In order to be secure enough, we are adding a second hash stored in a secret vault to avoid any reidentification of the users.

**Do I need to update my website's privacy policy?**

You need to ensure your Website Privacy Policy clearly informs your website visitors that phone numbers may be collected and shared with third-parties that you collaborate with to optimize campaign performance and that this information is hashed using the latest and most secure SHA256 hashing technology.

Additionally, you should inform your visitors that you respect their privacy, and should they prefer not to share such information, they can do so by selecting their preferred options in your website user cookie compliance banner (CMP).

Please refer to [Criteo's Privacy Policy](https://help.criteo.com/kb/guide/en/the-criteo-privacy-promise-pDIW4yiawH/Steps/775742) for more information, and you may also include the provided link within your website's Privacy Policy section. 

Should your legal team have any concerns relating to privacy, they may reach out to your Criteo business contact who will connect them with our legal team as needed.

How to implement

To provide the most flexibility to you, Criteo accepts users' phone numbers in these formats:

-   **SHA256 hashed** (in line with industry standards for addressable advertising).
    
-   **Plain text** (we will, immediately before logging the data, use SHA256 encryption on the phone numbers).

- If "SHA256": [SHA256](#step-4106563)
- If "Plain Text": [Plain Text](#step-4106562)

<a id="step-887074"></a>

## 다양한 사이트 유형을 사용하는 경우의 이벤트 설정

```javascript
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR_PARTNER_ID" async="true"></script>

<script type="text/javascript">

window.criteo_q = window.criteo_q || [];

var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

window.criteo_q.push(

    { event: "setAccount", account: YOUR UNIQUE ACCOUNT ID },

    { event: "setSiteType", type: deviceType },

    { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },

    { event: "viewHome"}

);

</script>
```

사이트의 모든 페이지에 내장된 Criteo OneTag에는 다이나믹 setSiteType 파라미터가 존재합니다. 사이트가 다양한 디바이스 버전을 지원한다면, **setSiteType** 파라미터를 통해 사용자에게 어떤 버전이 표시될지 지정을 해야 합니다.

-   데스크톱은 **d** 
-   모바일은 **m** 
-   태블릿은 **t** 

예:

사이트의 데스크톱 버전 setSiteType 파라미터:

 { event: "setSiteType", type: "d" },

  
사이트의 모바일 버전 setSiteType 파라미터: 

 { event: "setSiteType", type: "m" },

  
사이트의 태블릿 버전 setSiteType 파라미터:  
 

{ event: "setSiteType", type: "t" },

이 값을 동적으로 전송할 수 없는 경우, 다음 스크립트를 사용해 사용자가 데스크톱, 모바일 또는 태블릿 중 어떤 디바이스를 사용하는지 자동으로 감지할 수 있습니다.  
 

var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navig

  

 그런 다음 **deviceType** 파라미터를 이벤트에 배치해야 합니다. 이 경우 "**setSiteType**" 파라미터는 다음과 같습니다.  

 { event: "setSiteType", type: deviceType },

홈페이지 이벤트는 다음과 같습니다. 예:

<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR\_PARTNER\_ID" async="true"></script>

<script type="text/javascript">

window.criteo\_q = window.criteo\_q || \[\];

var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

window.criteo\_q.push(

    { event: "setAccount", account: YOUR UNIQUE ACCOUNT ID },

    { event: "setSiteType", type: deviceType },

    { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },

    { event: "viewHome"}

);

</script>

This path ends here.

<a id="step-887076"></a>

## 다수 국가에서 운영하는 경우의 이벤트 설정

```javascript
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR_PARTNER_ID" async="true"></script>
<script type="text/javascript"> 
    window.criteo_q = window.criteo_q || []; var criteo_ID = #Country Account ID#; 
    var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d"; 
    window.criteo_q.push(          
        { event: "setAccount", account: criteo_ID },          
        { event: "setSiteType", type: deviceType  },          
        { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },                  
        { event: "viewHome"}  ); 
</script>
```

웹사이트에서 여러 국가의 고객들에게 상품을 판매하는 경우, 각 국가별로 크리테오 **계정 ID**가 동적으로 전환되도록 만들어야 합니다. 

아래의 예시에서 **criteo\_ID** 파라미터가 홈페이지 이벤트에 추가된 것을 볼 수 있습니다. 이 파라미터 값은 사용자가 선택한 국가에 따라 특정 **#국가 계정ID#**에 맞게 동적으로 업데이트되어야합니다. 이 로직은 웹 사이트에 있는 Criteo OneTag의 각 인스턴스에 추가되어야 합니다.

Criteo OneTag에 구현된 국가별 계정 ID의 예:

<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR\_PARTNER\_ID" async="true"></script>

<script type="text/javascript">

window.criteo\_q = window.criteo\_q || \[\];

var criteo\_ID = #Country Account ID#;

var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

window.criteo\_q.push(

         { event: "setAccount", account: criteo\_ID },

         { event: "setSiteType", type: deviceType  },

         { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },        

         { event: "viewHome"}

 );

</script>

This path ends here.

<a id="step-887079"></a>

## 여러 통화를 사용하는 경우의 이벤트 설정

전 세계 사용자들이 이용하는 여행 웹 사이트처럼 사용자가 웹 사이트에서 다른 통화로 상품을 구매할 수 있는 경우, 구매한 상품에 통화를 지정할 수 있습니다. 

  
통화를 지정하면 크리테오가 보고서에 올바른 캠페인 통화를 표시할 수 있습니다.  
  
상품 가격은 장바구니 및 거래 이벤트에만 전달되므로, 이 함수는 Criteo OneTag에서 이 두 이벤트에만 사용되어야 합니다. 한 통화로 상품을 판매하는 경우 이 함수를 사용하면 안됩니다.  
  
이 함수를 사용하려면 유효한 ISO 통화 코드가 필요합니다.(참조: [https://www.iso.org/iso-4217-currency-codes.html](https://www.iso.org/iso-4217-currency-codes.html))

  
따라서 통화 코드에 해당하는 유효한 3자리 문자열을 입력해야 합니다. (예: 'EUR', 'USD', 'JPY'...)

-   ISO 통화 코드
    -   3자리 문자열
    -   유효 통화 코드(예: "EUR", "USD", "BRL"...)
-   대문자
    -   "JPY"은 사용할 수 있지만 "jpy"는 사용할 수 없습니다.

  

 사용 방법

사용자가 사이트에서 선택한 통화의 3자 문자열을 채웁니다. 가격 값은 사이트에 표시된 숫자와 정확히 일치해야 합니다. 사용자가 USD를 선택하고 가격이 100달러인 경우, Criteo OneTag의 가격은 100이어야 하며 통화는 USD가 되어야 합니다.  
  
**구문**

**통화** 파라미터는 다음과 같습니다.

통화: "JPY"  
  
**장바구니 이벤트**의 예시:

{ event: "viewBasket", currency : "JPY", item: \[

  { id: "1234", price: 10.2, quantity: 1 },

  { id: "2345", price: 11.2, quantity: 2 }

\]} 

  
**판매 이벤트**:

{ event: "trackTransaction", id: "12345", currency : "JPY", item: \[

  { id: "1234", price: 10.2, quantity: 1 },

  { id: "2345", price: 11.2, quantity: 2 }

\]} 

  
 

테스트 방법

브라우저 디버그 툴을 열고 F12를 누릅니다. 네트워크 탭에서 ‘크리테오’를 검색한 후 장바구니 또는 주문 확인 페이지(통화 함수가 구현된 페이지)로 이동합니다. 쿼리 문자열 파라미터는 옆 그림과 같아야 합니다.

This path ends here.

<a id="step-887071"></a>

## 동일한 장바구니를 사용하는 다수의 웹사이트를 위한 이벤트 설정

```javascript
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR_PARTNER_ID" async="true"></script>

 <script type="text/javascript">

 window.criteo_q = window.criteo_q || [];

var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

 window.criteo_q.push(

 { event: "manualFlush"},

 { event: "setAccount", account: TEST.COM ACCOUNT ID },

 { event: "setSiteType", type: deviceType },

 { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },

 { event: "viewBasket", item: [ { id: "TEST.COM PRODUCT ID", price: TEST.COM UNIT PRICE, quantity: TEST.COM PRODUCT QUANTITY }

 /* add a line for each product in the user's basket */

 ]},

 { event: "flushEvents"},

 { event: "setAccount", account: EXAMPLE.COM ACCOUNT ID },

 { event: "setSiteType", type: deviceType },

 { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },

 { event: "viewBasket", item: [ { id: "EXAMPLE.COM PRODUCT ID", price: EXAMPLE.COM UNIT PRICE, quantity: EXAMPLE.COM PRODUCT QUANTITY }

 /* add a line for each product in the user's basket */

 ]},

{ event: "flushEvents"}

);

</script>
```

다수의 웹사이트에서 동일한 장바구니 페이지를 사용하는 경우, Criteo OneTag에 이벤트의 수동 플러시를 설정해야 합니다. 

  
예를 들어, 두 개의 웹사이트 example.com과 test.com에서 동일한 장바구니 페이지 test.com/cart를 사용하는 경우, 이벤트에는 **manualFlush** 이벤트를, 각 구매 웹사이트에는 **flushEvents**를 추가해야 합니다.   
  
장바구니 페이지의 Criteo OneTag에 구현된 수동 플러시의 예:

<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR\_PARTNER\_ID" async="true"></script>

 <script type="text/javascript">

 window.criteo\_q = window.criteo\_q || \[\];

var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

 window.criteo\_q.push(

 { event: "manualFlush"},

 { event: "setAccount", account: TEST.COM ACCOUNT ID },

 { event: "setSiteType", type: deviceType },

 { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },

 { event: "viewBasket", item: \[ { id: "TEST.COM PRODUCT ID", price: TEST.COM UNIT PRICE, quantity: TEST.COM PRODUCT QUANTITY }

 /\* add a line for each product in the user's basket \*/

 \]},

 { event: "flushEvents"},

 { event: "setAccount", account: EXAMPLE.COM ACCOUNT ID },

 { event: "setSiteType", type: deviceType },

 { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },

 { event: "viewBasket", item: \[ { id: "EXAMPLE.COM PRODUCT ID", price: EXAMPLE.COM UNIT PRICE, quantity: EXAMPLE.COM PRODUCT QUANTITY }

 /\* add a line for each product in the user's basket \*/

 \]},

{ event: "flushEvents"}

);

</script>

This path ends here.

<a id="step-887073"></a>

## 다양한 결재 방식을 위한 이벤트 설정

```javascript
<!-- //Criteo Loader --> 
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR_PARTNER_ID" async="true">
</script>
 <!--............ --> 
 <script type="text/javascript"> 
 function load_Criteo_OneTag(){  
    window.criteo_q = window.criteo_q || [];  
    window.criteo_q.push(  
        { event: "setAccount", account: ##YOUR UNIQUE ACCOUNT ID## },  
        { event: "setSiteType", type: "m FOR MOBILE OR t FOR TABLET OR d FOR DESKTOP" },  
        { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },  
        { event: "trackTransaction", id: "TRANSACTION ID",  
        item: [ { 
            id: "FIRST PRODUCT ID", 
            price: ##FIRST PRODUCT UNIT PRICE##, 
            quantity: ##FIRST PRODUCT QUANTITY## },  
            { id: "SECOND PRODUCT ID", 
            price: ##SECOND PRODUCT UNIT PRICE##, 
            quantity: ##SECOND PRODUCT QUANTITY## }  
            /* add a line for each product in the user's basket */  
        ]}); } 
</script> 
<!--............ --> 
<button type="button" onclick="load_Criteo_OneTag()">PayPal</button>
```

Criteo OneTag는 사용자가 선택한 결제 방법에 상관없이 웹사이트의 주문 확인 페이지에 설치되어야 합니다. 그래야 판매된 상품 추적이 가능합니다.  
  
사용자가 구매한 상품을 추적함으로써, 크리테오는 배너 디스플레이를 최적화하고 사용자가 구매한 상품이 다시 표시되지 않도록 합니다. 각 결제 방법마다 다른 주문 확인 페이지가 있는 경우, 각 페이지에 Criteo OneTag가 구현되어 올바르게 작동하는지 확인하십시오.  

  
 도메인 외부의 거래

거래가 도메인 외부에서 이루어지는 결제 방법(예: PayPal)을 제공하는 경우, 해당 결제 방법을 사용하는 고객 중 상당수는 사이트로 다시 리디렉션되지 않을 수 있습니다. 고객이 자동으로 주문 확인/감사 페이지로 돌아오지 않는 경우 외부 도메인으로 리디렉션하는 ‘지금 결제하기’ 버튼에 Citeo OneTag를 구현하여 크리테오가 거래를 수집할 수 있도록 해야 합니다.  
  
아래의 예는 ‘PayPal’ 버튼에 Criteo OneTag를 구현하는 방법입니다. 하나의 함수만 추가하면 됩니다.  
  
**Criteo OneTag는 외부 판매를 추적하기 위해 버튼에 구현되어 있습니다**

 <!-- //Criteo Loader -->

<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR\_PARTNER\_ID" async="true"></script>

<!--............ -->

<script type="text/javascript">

function load\_Criteo\_OneTag(){

 window.criteo\_q = window.criteo\_q || \[\];

 window.criteo\_q.push(

 { event: "setAccount", account: YOUR UNIQUE ACCOUNT ID },

 { event: "setSiteType", type: "m FOR MOBILE OR t FOR TABLET OR d FOR DESKTOP" },

 { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },

 { event: "trackTransaction", id: "TRANSACTION ID",

 item: \[ { id: "FIRST PRODUCT ID", price: FIRST PRODUCT UNIT PRICE, quantity: FIRST PRODUCT QUANTITY },

 { id: "SECOND PRODUCT ID", price: SECOND PRODUCT UNIT PRICE, quantity: SECOND PRODUCT QUANTITY }

 /\* add a line for each product in the user's basket \*/

 \]});

}

</script>

<!--............ -->

<button type="button" onclick="load\_Criteo\_OneTag()">PayPal</button>

**여러 번의 클릭으로 야기되는 중복 트랜잭션을 방지하는 방법**  
  
사용자가 외부 결제 방법으로 리디렉션되는 ‘지금 결제하기’ 버튼을 여러 번 클릭하는 경우가 있습니다. 사용자가 클릭할 때마다 Criteo OneTag가 실행되지 않도록 변수를 추가해 이벤트가 한번 이상 실행되지 못하도록 만들 수 있습니다.  
  
다음 예시를 참조하십시오.  
  
**중복 클릭 감지를 위해 주문 확인 페이지에 구현된 Criteo OneTag:**  

 <!-- //Criteo Loader -->

<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR\_PARTNER\_ID" async="true"></script>

<!-- // Declare the variable -->

<script type="text/javascript">

 var cto\_clicked = false;

</script>

<!--............ -->

<script type="text/javascript">

function load\_Criteo\_OneTag(){

 if (!window.cto\_clicked){

 window.clicked = true;

 window.criteo\_q = window.criteo\_q || \[\];

 window.criteo\_q.push(

 { event: "setAccount", account: YOUR UNIQUE ACCOUNT ID },

 { event: "setSiteType", type: "m FOR MOBILE OR t FOR TABLET OR d FOR DESKTOP" },

 { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },

 { event: "trackTransaction", id: "TRANSACTION ID",

 item: \[ { id: "FIRST PRODUCT ID", price: FIRST PRODUCT UNIT PRICE, quantity: FIRST PRODUCT QUANTITY },

 { id: "SECOND PRODUCT ID", price: SECOND PRODUCT UNIT PRICE, quantity: SECOND PRODUCT QUANTITY }

 /\* add a line for each product in the user's basket \*/

 \]});

 }

}

</script>

<!--............ -->

<button type="button" onclick="load\_Criteo\_OneTag()">PayPal</button>

**임의 거래 ID 생성**  
  
주문에 Criteo OneTag로 전송될 관련 거래 ID가 없는 경우, 사용자가 ‘지금 결제하기’ 버튼을 누르면 이 랜던 함수를 사용해 거래 ID가 생성되도록 할 수 있습니다.  
  
**임의 함수:**  
  
 Math.floor(Math.random()\*9999999)  
  
아래 예시에서는 거래 ID를 보다 쉽게 식별할 수 있게 만들기 위해 임의 함수에 접두사 “button\_”이 붙습니다. 다수의 결제 옵션을 사용하는 경우, ‘버튼’이라는 단어를 사용자가 선택하는 방법으로 바꿀 수 있습니다. 예를 들어, PayPal로 리디렉션하는 버튼에 이 코드를 구현한 경우 "button\_" 대신 "PayPal\_"을 사용하여 거래를 보다 쉽게 식별할 수 있습니다.  
  
아래 코드는 거래 ID와 관련된 부분을 강조하기 위해 Criteo OneTag의 trackTransaction 이벤트에서 일부를 발췌한 것입니다.

**주문 확인 페이지에서 구현된 Criteo OneTag:**   

{ event: "trackTransaction", id: "PayPal\_" + Math.floor(Math.random()\*9999999),

 item: \[ { id: "FIRST PRODUCT ID", price: FIRST PRODUCT UNIT PRICE, quantity: FIRST PRODUCT QUANTITY },

 { id: "SECOND PRODUCT ID", price: SECOND PRODUCT UNIT PRICE, quantity: SECOND PRODUCT QUANTITY }

 /\* 사용자의 장바구니에 담긴 각 상품별로 라인 추가 \*/

\]});

Next: [How to avoid counting repeated transactions caused by multi-clicks](#step-4335430)

<a id="step-887078"></a>

## 여행업계 광고주를 위한 이벤트 설정

```javascript
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR_PARTNER_ID" async="true"></script>

 <script type="text/javascript">

 window.criteo_q = window.criteo_q || [];

 window.criteo_q.push(

 { event: "setAccount", account: YOUR_UNIQUE_ACCOUNT_ID },

 { event: "setSiteType", type: "d" },

 { event: "setEmail", email: "criteotest@test.com" },

 { event: "viewSearch", checkin_date: "2016-08-12", checkout_date: "2016-08-18"},

 { event: "viewBasket", item: [ { id: "FLIGHT_ID1", price: 299.99, quantity: 1 }



 ]});

 </script>
```

웹 사이트에 예약이나 상품 대여 날짜가 포함된 경우 **viewSearch 이벤트는** 캠페인 성과를 향상하는데 도움이 될 수 있습니다. 사이트에 **viewSearch** 이벤트를 구현하면, 사용자가 어떤 여행/상품의 예약/대여에 관심이 있는지 보다 잘 이해할 수 있습니다.  

viewSearch 이벤트

  
**viewSearch** 이벤트는 시작일과 종료일 모두들 수집합니다. 이 날짜는 크리테오의 AI 엔진이 상품 구매 전 정확한 시간에 보다 효과적으로 상품을 추천하는 데 도움을 줍니다. 또한 관심이 있던 시기가 지난 사용자에게 관련 없는 정보를 제공하지 않도록 필요한 정보도 제공해줍니다. 

  

  

 구현 방법

  
날짜가 사용된 모든 페이지의 Criteo OneTag에 다음 이벤트를 추가하기만 하면 됩니다. _yyyy-MM-dd_

  

 { event: "viewSearch", checkin\_date: "yyyy-MM-dd", checkout\_date: "yyyy-MM-dd"}

  
  
**viewSearch** 이벤트가 **장바구니 이벤트**에 구현되었다면, 이벤트는 다음과 같습니다. 

<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR\_PARTNER\_ID" async="true"></script>

 <script type="text/javascript">

 window.criteo\_q = window.criteo\_q || \[\];

 window.criteo\_q.push(

 { event: "setAccount", account: YOUR\_UNIQUE\_ACCOUNT\_ID },

 { event: "setSiteType", type: "d" },

 { event: "setEmail", email: "criteotest@test.com" },

 { event: "viewSearch", checkin\_date: "2016-08-12", checkout\_date: "2016-08-18"},

 { event: "viewBasket", item: \[ { id: "FLIGHT\_ID1", price: 299.99, quantity: 1 }

 \]});

 </script>

This path ends here.

<a id="step-887077"></a>

## 검색 목록 페이지의 Criteo OneTag로 전달되는 상품 ID가 3개 미만/이상인 경우

**카테고리** 또는 **검색 결과 페이지**와 마찬가지로, 검색 목록 페이지는 **다수의 상품**을 표시합니다. 이 페이지에 Criteo OneTag를 구현하면 특정 종류의 상품(예: 특정 카테고리의 상품)에 대한 사용자의 관심을 추적할 수 있습니다.

  
검색 목록 페이지의 Criteo OneTag 내에서 상위 세 개의 상품 ID를 전달하는 것이 좋습니다. 또는 페이지에 표시된 상품 중 세 개의 상품 ID를 전달할 수 있습니다.

3개 이상의 상품 ID가 전달되는 경우

  
3개 이상의 상품 ID가 전달되는 경우, 크리테오는 처음 전달된 세 개의 ID를 고려합니다. 최고의 성과를 얻으려면, ID를 3개만 전달하는 것이 좋습니다.

3개 미만의 상품 ID가 전달되는 경우

  
3개 미만의 상품 ID가 전달되는 경우, 크리테오는 사용자의 의도를 정확하게 분석할 수 없습니다. 이는 캠페인의 성과에 부정적인 영향을 미칠 수 있습니다. 그렇기 때문에, Criteo OneTag로 항상 3개 이상의 상품 ID가 전달되도록 해야 합니다.

이 규칙에 유일한 예외는 검색 결과에 3개 미만의 상품이 표시되는 경우입니다.

This path ends here.

<a id="step-887072"></a>

## netID 통합 설정

**European netID Foundation**

_"_European netID Foundation은 Medigrenuppe RTL Deutschland, ProSiebenSat.1 및 United Internet AG에 의해 2018년 3월에 설립되었습니다.__  

__이 재단은 미국 Single Sign-On(SSO) 제공자에 대한 유럽의 대안으로 netID를 확립하는 것을 목표로 합니다. 사용자는 netID Privacy Center를 통해 인터넷 서비스에 대한 동의를 투명하게 그리고 데이터 보호 규정에 따라 구성할 수 있습니다.__

__이를 위해, 이 재단은 모든 산업 분야의 사용자들이 동일한 로그인 데이터를 사용하여 재단 파트너의 모든 인터넷 서비스에 액세스할 수 있게 해주는 개방형 표준을 개발했습니다."__  
  
  
 

**netID**

_“_중앙 netID 계정을 사용해, 사용자는 많은 수의 인터넷 서비스에 쉽고 편리하게 로그인할 수 있습니다._  
_로그인 및 암호, 그리고 데이터 사용에 대한 사용자의 동의는 프라이버시 센터에서 투명하게 구성됩니다. 데이터에 대한 제어 권한이 전적으로 사용자에게 있다는 장점이 있습니다._  
_사용자는 언제든지 프라이버시 센터에서에서 자신의 동의를 변경할 수 있습니다._  
_netID는 이를 통해 높은 보안 표준과 최대의 데이터 주권을 보장합니다_."_

공식 netID 웹사이트를 방문하시려면 [여기](https://enid.foundation/en/netid/)를 클릭하십시오.  
  
  
 

**Onetag와 NetID 통합**

##으로 둘러싸인 필드를 동적으로 교체합니다. 필드에 대한 자세한 정보는 아래 표를 참조하십시오.

<script type="text/javascript">
    window.criteo\_q = window.criteo\_q || \[\];
    window.criteo\_q.push({
        event: 'setIdentity',
        identity: {
            source: "netid.de",
            uids: \[{
                id: "##NetID##"
            }\]
        }
    });
</script>

  

 **setIdentity event**

이 이벤트는 이벤트 큐에 있는 다른 이벤트와 마찬가지로 실행되어야 합니다.

This path ends here.

<a id="step-1948825"></a>

## SHA256 및 MD5(선호)

Criteo는 MD5/SHA256MD5를 통한 이메일 해싱에서 SHA256으로 ID 그래프를 마이그레이션하고 있습니다. 특히 마이그레이션 기간 동안 데이터와 ID 그래프 간의 일치율을 최대화하려면 새 SHA256 형식과 함께 레거시 형식(MD5 또는 SHA256MD5)을 공유하십시오.

다음은 **setEmail** 이벤트에서 전송된 MD5 이메일과 함께 SHA256 해시 이메일의 예입니다.

`{ event: "setEmail", email: "##Hashed Email Address##", hash_method: "md5" }`

`{ event: "setEmail", email: "##Hashed Email Address##", hash_method: "sha256" }`

> **Tip:** 해싱 전에 모든 사용자의 이메일 주소는 다음과 같아야 합니다.
>
> -   손질; 사용자 이메일 주소 앞뒤의 모든 공백이 제거되었습니다.
>     
> -   소문자로 변환되었습니다.
>     
> -   UTF-8로 인코딩됩니다.

**setEmail** 이벤트는 웹사이트에 있는 모든 Criteo 이벤트 태그(예: Homepage, Product. AddToCart, Basket, Sales/Conversion)에 추가되어야 웹사이트에서 사용할 수 있을 때마다 이메일이 전달됩니다.

아래 단계는 이 이벤트가 SHA256과 함께 MD5의 조합 또는 SHA256과 함께 SHA256MD5의 조합으로 Criteo의 홈페이지 태그에서 어떻게 보이는지에 대한 예입니다.

- If "MD5와 함께 SHA256": [Example](#step-1950389)
- If "SHA256MD5와 함께 SHA256": [Example](#step-1950652)

<a id="step-1948824"></a>

## SHA256 해시

SHA256 해시 이메일을 전달하는 경우 **setEmail** 이벤트를 사용하십시오.

다음은 **setEmail** 이벤트에서 전송된 SHA256 해시 이메일의 예입니다.

`{ event: "setEmail", email: "46a828eb4c5d239d631a15094c934cada1812d5fc22cd14155ca684832a70938", hash_method: "sha256" }`

> **Tip:** 해싱 전에 모든 사용자의 이메일 주소는 다음과 같아야 합니다.
>
> -   손질; 사용자의 이메일 주소 앞뒤의 모든 공백이 제거되었습니다.
>     
> -   소문자로 변환되었습니다.
>     
> -   UTF-8로 인코딩됩니다.

**setEmail** 이벤트는 웹사이트에 있는 모든 Criteo 이벤트 태그(예: Homepage, Product. AddToCart, Basket, Sales/Conversion)에 추가되어야 웹사이트에서 사용할 수 있을 때마다 이메일이 전달됩니다.

아래 단계는 이 이벤트가 Criteo의 홈페이지 태그에서 어떻게 보이는지 보여주는 예입니다.

Next: [Example](#step-1950477)

<a id="step-1948817"></a>

## 일반 텍스트

```javascript
<!-- Criteo Homepage Tag -->

<script type="text/javascript">

  window.criteo_q = window.criteo_q || [];

  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

  window.criteo_q.push(

    { event: "setAccount", account: YOUR_PARTNER_ID},
    { event: "setEmail", email: "##Email Address##"},
    { event: "setSiteType", type: deviceType},
    { event: "setCustomerId", id: "##Customer Id##" },
    { event: "setRetailerVisitorId", id: "##Visitor Id##"},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewHome" }

  );

</script>

<!-- END Criteo Homepage Tag -->
```

일반 텍스트 이메일을 전달하는 경우 **setEmail** 이벤트를 사용하십시오.

일반 이메일 주소가 전송되는 경우 Criteo는 사용자의 이메일 주소를 데이터베이스에 저장하기 전에 자동으로 암호화합니다. 다음은 **setEmail** 이벤트에서 보낸 일반 텍스트 이메일의 예입니다.

`{ event: "setEmail", email: "user@example.com" },`

  
해싱되지 않은 이메일 주소나 해싱된 이메일 주소를 전달할 수 없는 경우 빈 문자열을 전달하기만 하면 됩니다.

`{ event: "setEmail", email: "" },`

> **Warning:** 일부 국가에서는 데이터가 저장 전에 해시되는지 여부에 관계없이 현지 법률로 인해 일반 텍스트 이메일 주소를 제3자에게 전달하는 것이 허용되지 않습니다. Criteo는 사용자 정보를 공유하기 전에 항상 해싱할 것을 권장하지만 일반 텍스트 이메일을 공유하는 것도 옵션입니다. 그러나 해시되지 않은 정보를 공유하기로 결정한 경우 유효한 법률을 인지하고 비즈니스 및 운영하는 시장에 가장 적합한 접근 방식을 결정하는 것은 고객의 몫입니다.

> **Tip:** 일반 텍스트를 전달할 때 모든 사용자의 이메일 주소는 다음과 같아야 합니다.
>
> -   손질; 사용자의 이메일 주소 앞뒤의 모든 공백이 제거되었습니다.
>     
> -   소문자로 변환되었습니다.
>     
> -   UTF-8로 인코딩됩니다.

**setEmail** 이벤트는 웹사이트에 있는 모든 Criteo 이벤트 태그(예: Homepage, Product. AddToCart, Basket, Sales/Conversion)에 추가되어야 웹사이트에서 사용할 수 있을 때마다 이메일이 전달됩니다.

다음은 Criteo의 홈페이지 태그에서 SHA256 해시를 사용하여 이 이벤트가 어떻게 보이는지 보여주는 예입니다.

This path ends here.

<a id="step-1950390"></a>

## MD5 또는 SHA256MD5(레거시)

MD5 또는 SHA256MD5 해시 이메일을 전달하는 경우 **setEmail** 이벤트를 사용하십시오.

다음은 **setEmail** 이벤트에서 전송된 MD5 해시 이메일의 예입니다.

`{ event: "setEmail", email: "f3ada405ce890b6f8204094deb12d8a8", hash_method: "sha256" }`

다음은 **setEmail** 이벤트에서 전송된 SHA256MD5의 예입니다.

`{ event: "setEmail", email: "0fb0ecec887b92bd4a793669f9a52e8c2af81cdf8a59bc7399c9bc910853fb66", hash_method: "sha256_md5" },`

> **Tip:** 해싱 전에 모든 사용자의 이메일 주소는 다음과 같아야 합니다.
>
> -   손질; 사용자의 이메일 주소 앞뒤의 모든 공백이 제거되었습니다.
>     
> -   소문자로 변환되었습니다.
>     
> -   UTF-8로 인코딩됩니다.

**setEmail** 이벤트는 웹사이트에 있는 모든 Criteo 이벤트 태그(예: Homepage, Product. AddToCart, Basket, Sales/Conversion)에 추가되어야 웹사이트에서 사용할 수 있을 때마다 이메일이 전달됩니다.

아래 단계는 이 이벤트가 Criteo의 홈페이지 태그에서 어떻게 보이는지 보여주는 예를 보여줍니다.

- If "MD5 해시": [Example](#step-1958150)
- If "SHA256MD5 해시": [Example](#step-1958151)

<a id="step-1948827"></a>

## 해싱 함수

사용자의 이메일 주소가 Criteo로 전달되기 전에 해싱하는 경우 다음 기능 중 하나를 사용하여 적절한 암호화를 보장할 수 있습니다.

- If "JavaScript를 사용한 SHA256 해싱 함수": [SHA256 Hashing Function using JavaScript](#step-1957333)
- If "SHA256 C\#을 사용한 해싱 함수": [SHA256 Hashing function using C\#](#step-1951709)
- If "SHA256 자바를 이용한 해싱 함수": [SHA256 Hashing function using Java](#step-1951710)
- If "SHA256 Perl을 사용한 해싱 함수": [SHA256 Perl을 사용한 해싱 함수](#step-1951708)
- If "PHP를 사용한 SHA256 해싱 함수": [PHP를 사용한 SHA256 해싱 함수](#step-1951742)
- If "PHP를 사용한 MD5 해싱 함수": [PHP를 사용한 MD5 해싱 함수](#step-1951849)
- If "C\#을 사용한 MD5 해싱 함수": [C\#을 사용한 MD5 해싱 함수](#step-1951850)
- If "Java를 사용한 MD5 해싱 함수": [Java를 사용한 MD5 해싱 함수](#step-1951851)
- If "MD5 hashing function using JS": [MD5 hashing function using JS](#step-3858724)

<a id="step-1948826"></a>

## 자주하는 질문

**내 웹사이트의 개인정보 보호정책을 업데이트해야 합니까?**

귀하의 웹사이트 개인정보 보호정책은 이메일 주소가 수집되고 캠페인 성과를 최적화하기 위해 협력하는 제3자와 공유될 수 있으며 이 정보가 가장 안전한 최신 SHA256 해싱 기술을 사용하여 해싱된다는 사실을 웹사이트 방문자에게 명확하게 알리도록 해야 합니다. 따라서 PII 데이터는 제3자와 공유되지 않습니다.

또한 방문자에게 귀하가 그들의 개인정보를 존중한다는 사실을 알려야 하며 방문자가 이러한 정보를 공유하지 않기를 원하는 경우 웹사이트 사용자 쿠키 준수 배너(CMP)에서 선호하는 옵션을 선택하여 방문자가 공유할 수 있습니다.

자세한 내용은 [Criteo의 개인정보 보호정책](https://help.criteo.com/kb/guide/en/the-criteo-privacy-promise-pDIW4yiawH/Steps/775742) 을 참조하고 웹사이트의 개인정보 보호정책 섹션에 제공된 링크를 포함할 수도 있습니다.

> **Tip:** 법무팀이 개인정보 보호와 관련하여 우려 사항이 있는 경우 필요에 따라 당사 법무팀과 연결해 줄 Criteo 비즈니스 담당자에게 연락할 수 있습니다.

**이미 태그에 MD5 형식으로 해시된 이메일을 전달하고 있습니다. 어떻게 해야 합니까?**

계속해서 이 방법을 전달하고 "hash-method" 매개변수가 "md5"로 설정되어 있는지 확인해야 합니다. Criteo는 이 문자열 을 저장하기 전에 추가로 SHA256을 통해 인코딩합니다.

그런 다음 모든 Criteo 태그에 ' **setEmail** ' 이벤트를 추가하여 SHA256도 전달해야 합니다. 이 추가 이벤트가 추가되면 "hashed\_method" 매개변수가 "sha256"으로 설정되어 있는지 확인하십시오. 예:

`{ event: "setEmail", email: "##Hashed Email Address##", hash_method: "md5" }`

`{ event: "setEmail", email: "##Hashed Email Address##", hash_method: "sha256" }`

**내 태그에 SHA256MD5 형식으로 해시된 이메일을 이미 전달하고 있습니다. 어떻게 해야 합니까?**

계속해서 이 방법을 전달하고 "hash-method" 매개변수가 "md5"로 설정되어 있는지 확인해야 합니다. Criteo는 이 문자열을 사용하고 저장하기 전에 SHA256 해시 인코딩을 추가로 수행합니다.

그런 다음 모든 Criteo 태그에 ' **setEmail** ' 이벤트를 추가하여 SHA256도 전달해야 합니다. 이 추가 이벤트가 추가되면 "hashed\_method" 매개변수가 "sha256"으로 설정되어 있는지 확인하십시오. 예:

`{ event: "setEmail", email: "##Hashed Email Address##", hash_method: "sha256_md5" }`

`{ event: "setEmail", email: "##Hashed Email Address##", hash_method: "sha256" }`

**SHA256으로 해시된 이메일만 전달할 수 있습니다. 어떻게 해야 합니까?**

변경할 필요가 없습니다. "hash\_method" 매개변수가 "sha256"으로 설정되어 있는지 확인하십시오. 예:

`{ event: "setEmail", email: "##Hashed Email Address##", hash_method: "sha256" }`

This path ends here.

<a id="step-4106563"></a>

## SHA256

```javascript
<!-- Criteo Homepage Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: YOUR_PARTNER_ID},
    { event: "setEmail", email: "##Email Address##", hash_method: "sha256" },
    { event: "setSha256HashedPhoneNumber", phone_number: "fda66831d0cb0eb4bffb21bc795308d69921c211c57be0ae15702071e3b9e989" },
    { event: "setSiteType", type: deviceType},
    { event: "setCustomerId", id: "##Customer Id##" },
    { event: "setRetailerVisitorId", id: "##Visitor Id##"},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewHome" }
  );
</script>
```

As phone numbers are a sensitive PII, Criteo accepts hashed phone numbers from partners and encourages it. 

Expected underlying phone numbers format is a trimmed [E.164](https://en.wikipedia.org/wiki/E.164) format including the country code, without the leading "+" sign (so only 15 digits, at most): sha256(internationalPhoneNumber.replaceAll(/\[^0-9\]/g, "")).

**Examples:**

-   1 (234) 567-8910 → sha256(12345678910) → 63640264849a87c90356129d99ea165e37aa5fabc1fea46906df1a7ca50db492
    
-   81-12-3456-7891 → sha256(811234567891) → d9825fb05347d3c910fc5202c0c20d07a87b791cc643c6f2d70402394a849540
    
-   02 1234 5678 → sha256(0212345678) → 826f54894e28f3f1795f3c5e3335cf98709c5d5b38b3f9c6d72467d491f032df
    
-   +33 1 40 40 22 90 → sha256(33140402290) → fda66831d0cb0eb4bffb21bc795308d69921c211c57be0ae15702071e3b9e988
    

Please use the **setSha256HashedPhoneNumber** event if you are passing SHA256 hashed phone numbers. Here is an example of the SHA256 hashed phone number sent in the setSha256HashedPhoneNumber event:

`{ event: "setSha256HashedPhoneNumber", phone_number: "fda66831d0cb0eb4bffb21bc795308d69921c211c57be0ae15702071e3b9e989" }`

The **setSha256HashedPhoneNumber** event should be added to **all of the Criteo event tags** that are on your website (e.g. Homepage, Product. AddToCart, Basket, Sales/Conversion), so that the phone number is passed whenever your website has it available.

Examples of how this event looks in Criteo's Homepage tag is visible on the left side.

This path ends here.

<a id="step-4106562"></a>

## Plain Text

```javascript
<!-- Criteo Homepage Tag -->
<script type="text/javascript">
  window.criteo_q = window.criteo_q || [];
  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
  window.criteo_q.push(
    { event: "setAccount", account: YOUR_PARTNER_ID},
    { event: "setEmail", email: "##Email Address##", hash_method: "sha256" },
    { event: 'setPhoneNumber', phone_number: '+33 (0) 1 40 40 22 90' },
    { event: "setSiteType", type: deviceType},
    { event: "setCustomerId", id: "##Customer Id##" },
    { event: "setRetailerVisitorId", id: "##Visitor Id##"},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewHome" }
  );
</script>
```

**In the event that a plain phone number is sent, Criteo will encrypt the user’s phone number automatically before it is saved in our database.**

On Criteo's side we will validate and normalize the numbers collected. Any international formats are accepted (including the leading "+" sign). Normalization removes all non numeric characters.

**Validation checks:**

-   Number starts with a + sign
    
-   length is at most 15 digits
    
-   there is no leading 0: many countries use 0 as national dial number
    

**Examples:**

-   +1 (234) 567-8910
    
-   +81-12-3456-7891
    
-   +33 1 40 40 22 90
    
-   02 1234 5678 is **rejected** because of a leading 0 indicating that it is a national phone number
    

As with other ids, phone numbers will be hashed before being stored. Criteo's backend maps the clear phone numbers to SHA256 HPN so the two accepted formats are uniform. Criteo doesn't have access to any phone number shared with us.  

> **Tip:** Although clear-text phone numbers are accepted, **it's highly recommended to use the SHA-256 hash** when sharing any type of user information.

> **Tip:** **Note:** In some countries, it is not allowed to pass clear-text phone numbers to third parties due to local legislation, regardless of whether the data is hashed before storage. While Criteo recommends always hashing any user information before sharing it with us, sharing clear-text phone numbers is also an option. However, you must be aware of the laws in effect and decide the best approach for your business and the market(s) you operate, in case you decide to share non-hashed information.

Please use the **setPhoneNumber** event if you are passing plain text phone numbers. Here is an example of a plain phone number sent in the setPhoneNumber event:

`{ event: 'setPhoneNumber', phone_number: '+33 (0) 1 40 40 22 90' }`

The **setPhoneNumber** event should be added to **all of the Criteo event tags** that are on your website (e.g. Homepage, Product. AddToCart, Basket, Sales/Conversion), so that the phone number is passed whenever your website has it available.  
  
Examples of how this event looks in Criteo's Homepage tag is shown on the left.

This path ends here.

<a id="step-4335430"></a>

## How to avoid counting repeated transactions caused by multi-clicks

```javascript
<!-- //Criteo Loader --> 
 <script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR_PARTNER_ID" async="true">
</script> 
<!-- // Declare the variable --> 
<script type="text/javascript">  
    var cto_clicked = false; 
</script> 
<!--............ --> 
<script type="text/javascript"> 
function load_Criteo_OneTag(){  
    if (!window.cto_clicked){  
        window.clicked = true;  
        window.criteo_q = window.criteo_q || [];  
        window.criteo_q.push(  
            { event: "setAccount", account: ##YOUR UNIQUE ACCOUNT ID## },  
            { event: "setSiteType", type: "m FOR MOBILE OR t FOR TABLET OR d FOR DESKTOP" },  
            { event: "setEmail", email: "TRIMMED AND LOWERCASE USER EMAIL ADDRESS" },  
            { event: "trackTransaction", id: "TRANSACTION ID",  
            item: [ 
                { id: "FIRST PRODUCT ID", 
                price: ##FIRST PRODUCT UNIT PRICE##, 
                quantity: ##FIRST PRODUCT QUANTITY## },  
                { id: "SECOND PRODUCT ID", 
                price: ##SECOND PRODUCT UNIT PRICE##, 
                quantity: ##SECOND PRODUCT QUANTITY##} 
                 /* add a line for each product in the user's basket */  
            ]});  } } 
</script> 
<!--............ --> 
<button type="button" onclick="load_Criteo_OneTag()">PayPal</button>
```

Sometimes users will double-click the Pay Now button that redirects to the external payment method. To avoid executing the Criteo OneTag each time the user clicks, you can add a variable that prevents the event from being executed more than once.  
  
**The Criteo OneTag implemented on a Sales Confirmation page with multi-click detection is on the left.**

Next: [Generating a random Transaction ID](#step-4335431)

<a id="step-1950389"></a>

## Example

```javascript
<!-- Criteo Homepage Tag -->

<script type="text/javascript">

  window.criteo_q = window.criteo_q || [];

  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

  window.criteo_q.push(

    { event: "setAccount", account: YOUR_PARTNER_ID},
    { event: "setEmail", email: "##Email Address##", hash_method: "sha256" },
    { event: "setEmail", email: "##Email Address##", hash_method: "md5" },
    { event: "setSiteType", type: deviceType},
    { event: "setCustomerId", id: "##Customer Id##" },
    { event: "setRetailerVisitorId", id: "##Visitor Id##"},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewHome" }

  );

</script>

<!-- END Criteo Homepage Tag -->
```

This path ends here.

<a id="step-1950652"></a>

## Example

```javascript
<!-- Criteo Homepage Tag -->

<script type="text/javascript">

  window.criteo_q = window.criteo_q || [];

  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

  window.criteo_q.push(

    { event: "setAccount", account: YOUR_PARTNER_ID},
    { event: "setEmail", email: "##Email Address##", hash_method: "sha256" },
    { event: "setEmail", email: "##Email Address##", hash_method: "sha256_md5" },
    { event: "setSiteType", type: deviceType},
    { event: "setCustomerId", id: "##Customer Id##" },
    { event: "setRetailerVisitorId", id: "##Visitor Id##"},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewHome" }

  );

</script>

<!-- END Criteo Homepage Tag -->
```

This path ends here.

<a id="step-1950477"></a>

## Example

```javascript
<!-- Criteo Homepage Tag -->

<script type="text/javascript">

  window.criteo_q = window.criteo_q || [];

  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

  window.criteo_q.push(

    { event: "setAccount", account: YOUR_PARTNER_ID},
    { event: "setEmail", email: "##Email Address##", hash_method: "sha256" },
    { event: "setSiteType", type: deviceType},
    { event: "setCustomerId", id: "##Customer Id##" },
    { event: "setRetailerVisitorId", id: "##Visitor Id##"},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewHome" }

  );

</script>

<!-- END Criteo Homepage Tag -->
```

This path ends here.

<a id="step-1958150"></a>

## Example

```javascript
<!-- Criteo Homepage Tag -->

<script type="text/javascript">

  window.criteo_q = window.criteo_q || [];

  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

  window.criteo_q.push(

    { event: "setAccount", account: YOUR_PARTNER_ID},
    { event: "setEmail", email: "##Email Address##", hash_method: "md5" },
    { event: "setSiteType", type: deviceType},
    { event: "setCustomerId", id: "##Customer Id##" },
    { event: "setRetailerVisitorId", id: "##Visitor Id##"},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewHome" }

  );

</script>

<!-- END Criteo Homepage Tag -->
```

This path ends here.

<a id="step-1958151"></a>

## Example

```javascript
<!-- Criteo Homepage Tag -->

<script type="text/javascript">

  window.criteo_q = window.criteo_q || [];

  var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";

  window.criteo_q.push(

    { event: "setAccount", account: YOUR_PARTNER_ID},
    { event: "setEmail", email: "##Email Address##", hash_method: "sha256_md5" },
    { event: "setSiteType", type: deviceType},
    { event: "setCustomerId", id: "##Customer Id##" },
    { event: "setRetailerVisitorId", id: "##Visitor Id##"},
    { event: "setZipcode", zipcode: "##Zip Code##" },
    { event: "viewHome" }

  );

</script>

<!-- END Criteo Homepage Tag -->
```

This path ends here.

<a id="step-1957333"></a>

## SHA256 Hashing Function using JavaScript

```javascript
async function sha256(message) {
  // encode as UTF-8
  const msgBuffer = new TextEncoder('utf-8').encode(message);

  // hash the message
  const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer);

  // convert ArrayBuffer to Array
  const hashArray = Array.from(new Uint8Array(hashBuffer));

  // convert bytes to hex string
  const hashHex = hashArray.map(b => ('00' + b.toString(16)).slice(-2)).join('');
  return hashHex;
}

function format(email) {
	return email.toLowerCase().trim();
}

var email = "   uSèr@example.Com   ";
//CHANGE BASED ON WHAT YO USUALLY PUT AS EXAMPLE
var hemPromise = sha256(format(email));
hemPromise.then(hem => console.log(hem));
```

This path ends here.

<a id="step-1951709"></a>

## SHA256 Hashing function using C\#

```text/x-csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
namespace Sample_EmailHashing_code {
  public class CriteoHashedEmailFormatter {
    private static SHA256 _sha256;
    private static SHA256 Sha256 {
      get {
        return _sha256 ?? (_sha256 = SHA256.Create());
      }
    }
    private static string Sha256Encode(string sourceString) {
      byte[] inputBytes = Encoding.UTF8.GetBytes(sourceString);
      byte[] hash = Sha256.ComputeHash(inputBytes);
      var sb = new StringBuilder(32);
      foreach(byte b in hash) sb.Append(b.ToString("x2"));
      return sb.ToString();
    }
    public static string HashEmail(string sourceEmail) {
      String processedEmail;
      processedEmail = sourceEmail.ToLowerInvariant(); //conversion to lower case
      processedEmail = processedEmail.Trim(); //trimming leading and trailing spaces
      processedEmail = Sha256Encode(processedEmail); //conversion to UTF-8 and hashing with SHA256
      return processedEmail;
    }
  }
  class SampleEmailHashing {
    static void Main(string[] args) {
      String sourceEmail = "   uSèr@example.Com   ";
      String processedEmail = CriteoHashedEmailFormatter.HashEmail(sourceEmail);
      Console.WriteLine(processedEmail);
      Console.ReadKey();
    }
  }
}
```

This path ends here.

<a id="step-1951710"></a>

## SHA256 Hashing function using Java

```text/x-java
import java.io.*;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class SampleEmailHashing {
  public static void main(String[] args) {
    String sourceEmail = new String(" uSèr@example.Com ");
    String processedEmail = FormatMail(sourceEmail);
    System.out.println(processedEmail);
  } //Method to format the source Email, converting to lower case and removing spaces               
  private static String FormatMail(String mail) {
    String newMail = new String(mail);
    // conversion to lower case characters          
    newMail = newMail.toLowerCase();
    //remove empty spaces          
    newMail = newMail.trim();
    newMail = sha256Java(newMail);
    return newMail;
  } //Method to encrypt email address using MD5      
  public static String sha256Java(String message) {
    String digest = null;
    try { //conversion to UTF-8 and hashing with SHA256
      MessageDigest md = MessageDigest.getInstance("SHA256");
      byte[] hash = md.digest(message.getBytes("UTF-8"));
      StringBuilder sb = new StringBuilder(2 * hash.length);
      for (byte b: hash) {
        sb.append(String.format("%02x", b & 0xff));
      }
      digest = sb.toString();
    } catch (UnsupportedEncodingException ex) {
      ex.printStackTrace();
    } catch (NoSuchAlgorithmException ex) {
      ex.printStackTrace();
    }
    return digest;
  }
}
```

This path ends here.

<a id="step-1951708"></a>

## SHA256 Perl을 사용한 해싱 함수

```perl
#!/usr/bin/perl  

 use strict;  

 use warnings;  

 use Digest::SHA256 qw(sha256 sha256_hex);  

 use Encode;  

 my $original_email  = qw/ uSèr@example.Com /;  

 my $processed_email = lc($original_email);     

    $processed_email =~ s/^\s+//;     

    $processed_email =~ s/\s+$//;     

    $processed_email = encode_utf8($processed_email);     

    $processed_email = sha256_hex($processed_email);  

 print "Original email:\t$original_email\n";  

 print "Hashed email:\t$processed_email \n"; 
```

This path ends here.

<a id="step-1951742"></a>

## PHP를 사용한 SHA256 해싱 함수

```php
$source_address = "uSèr@example.Com "; 
$processed_address = strtolower($source_address); //convert address to lower case 
$processed_address = trim($processed_address); //trimming leading and trailing spaces
$processed_address = mb_convert_encoding($processed_address, "UTF-8", "ISO-8859-1"); //conversion from ISO-8859-1 to UTF-8 (replace "ISO-8859-1" with the source encoding of your string) 
$processed_address = hash('sha256', $processed_address, false); //hash address with SHA256 algorithm 
echo "Source e-mail: ".$source_address." | Hashed e-mail: ".$processed_address;
```

This path ends here.

<a id="step-1951849"></a>

## PHP를 사용한 MD5 해싱 함수

```php
$source_address = "uSèr@example.Com "; 
$processed_address = strtolower($source_address); //convert address to lower case 
$processed_address = trim($processed_address); //trimming leading and trailing spaces 
$processed_address = mb_convert_encoding($processed_address, "UTF-8", "ISO-8859-1"); //conversion from ISO-8859-1 to UTF-8 (replace "ISO-8859-1" with the source encoding of your string) 
$processed_address = hash('md5', $processed_address, false); //hash address with SHA256 algorithm 
echo "Source e-mail: ".$source_address." | Hashed e-mail: ".$processed_address;
```

This path ends here.

<a id="step-1951850"></a>

## C\#을 사용한 MD5 해싱 함수

```text/x-csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
namespace Sample_EmailHashing_code {
  public class CriteoHashedEmailFormatter {
    private static MD5 _md5;
    private static MD5 Md5 {
      get {
        return _md5 ?? (_md5 = MD5.Create());
      }
    }
    private static string Md5Encode(string sourceString) {
      byte[] inputBytes = Encoding.UTF8.GetBytes(sourceString);
      byte[] hash = Md5.ComputeHash(inputBytes);
      var sb = new StringBuilder(32);
      foreach(byte b in hash) sb.Append(b.ToString("x2"));
      return sb.ToString();
    }
    public static string HashEmail(string sourceEmail) {
        String processedEmail;
        processedEmail = sourceEmail.ToLowerInvariant(); //conversion to lower case              
        processedEmail = processedEmail.Trim(); //trimming leading and trailing spaces              
        //conversion to UTF-8 and hashing with SHA256              
        processedEmail = Md5Encode(processedEmail);              
        return processedEmail;          
    }      
  }      
  class SampleEmailHashing      {          
    static void Main(string[] args)          {              
      String sourceEmail = "   uSèr@example.Com   ";              
      String processedEmail = CriteoHashedEmailFormatter.HashEmail(sourceEmail);              
      Console.WriteLine(processedEmail);              Console.ReadKey();          
    }      
  }  
}
```

This path ends here.

<a id="step-1951851"></a>

## Java를 사용한 MD5 해싱 함수

```clike
import java.io.*;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class SampleEmailHashing {
  public static void main(String[] args) {
    String sourceEmail = new String(" uSèr@example.Com ");
    String processedEmail = FormatMail(sourceEmail);
    System.out.println(processedEmail);
  } //Method to format the source Email, converting to lower case and removing spaces               
  private static String FormatMail(String mail) {
    String newMail = new String(mail);
    // conversion to lower case characters          
    newMail = newMail.toLowerCase();
    //remove empty spaces          
    newMail = newMail.trim();
    newMail = md5Java(newMail);
    return newMail;
  } //Method to encrypt email address using MD5      
  public static String md5Java(String message) {
    String digest = null;
    try { //conversion to UTF-8 and hashing with MD5
      MessageDigest md = MessageDigest.getInstance("MD5");
      byte[] hash = md.digest(message.getBytes("UTF-8"));
      StringBuilder sb = new StringBuilder(2 * hash.length);
      for (byte b: hash) {
        sb.append(String.format("%02x", b & 0xff));
      }
      digest = sb.toString();
    } catch (UnsupportedEncodingException ex) {
      ex.printStackTrace();
    } catch (NoSuchAlgorithmException ex) {
      ex.printStackTrace();
    }
    return digest;
  }
}
```

This path ends here.

<a id="step-3858724"></a>

## MD5 hashing function using JS

```javascript
// md5 function should be provided by the client (by installing a 3rd party one)

function format(email) {
	return email.toLowerCase().trim();
}

var email = "   uSèr@example.Com   ";
var hemPromise = md5(format(email));
hemPromise.then(hem => console.log(hem));
```

> **Tip:** **Important**
>
> Make sure to install this external library [https://www.md5.cz/javascript-md5](https://www.md5.cz/javascript-md5b) before you implement the code in the page.

This path ends here.

<a id="step-4335431"></a>

## Generating a random Transaction ID

```javascript
<!--............ --> 
{ event: "trackTransaction", 
    id: "PayPal_" + Math.floor(Math.random()*9999999),  
    item: [ 
        { id: "FIRST PRODUCT ID", 
        price: ##FIRST PRODUCT UNIT PRICE##, 
        quantity: ##FIRST PRODUCT QUANTITY## },  
        { id: "SECOND PRODUCT ID", 
        price: ##SECOND PRODUCT UNIT PRICE##, 
        quantity: ##SECOND PRODUCT QUANTITY## }  
        /* add a line for each product in the user's basket */ 
    ]}); 
<!--............ -->  
```

In the event that the order does not have an associated Transaction ID to pass into the Criteo OneTag when the user clicks on the Pay Now button, you can use this random function to generate one.  
  
**Random function:**  
  
 Math.floor(Math.random()\*9999999)  
  
In the example below, this random function is combined with the prefix "Button\_" in order to create a Transaction ID that is more easily identified. Where you use multiple payment options you can change the word "Button" for the method selected by the user. For example, if you implemented this code on a button that redirects to PayPal, you can use "PayPal\_" instead of "Button\_" so it is even easier to identify the transaction.  
  
Note that the code on the left is just an extract of the trackTransaction event of the Criteo OneTag in order to highlight the portion relating to the Transaction ID.  
  
**The Criteo OneTag implemented on a Sales Confirmation page on the left.**

This path ends here.
