Iniciar sesión

Bienvenido al Centro de soporte técnico

Obtenga ayuda con la integración y las campañas en vivo.

Bienvenido al Centro de soporte técnico. Obtenga ayuda con la integración y las campañas en vivo.

Paso 2 Google Tag Manager: Variables

Visión general

On this step you will teach Google Tag Manager how to retrieve the information contained in your dataLayer. After the variables are set up, the information that is available in the dataLayer will be fed automatically into the Criteo OneTag.

Create the variables

Below you will find a list of all variables that have to be created, and the details to fill in. We will use the same names that have been defined in Step 1: dataLayer. [link here to step 1, article doesn't have fixed URL for now]

Setting up the variables is very easy:

1. Haga clic en Variables > User-Defined Variables > NEW (Variables > Variables definidas por el usuario > NUEVA).

2. Give the variable a name, type and value using the list below

Variables list

CriteoPartnerID

  • Tipo de variable: string (cadena de caracteres) constante
  • Identificador de cuenta proporcionado en la guía Criteo Onetag. Fíjese, por ejemplo, en la línea:
{ event: "setAccount", account: 11532},

 

CriteoEmail

  • Tipo de variable: variable de la capa de datos
  • Elija el nombre de la variable dataLayer que configuró para la dirección de correo electrónico, en este ejemplo es "email":
<script type="text/javascript">
dataLayer = dataLayer || [];
dataLayer.push({
'email': 'john@doe.com'
});
</script>

 

CriteoSiteType

  • Tipo de variable: JavaScript personalizado
  • Utilice la siguiente script (secuencia de comandos) para definir el dispositivo utilizado por el usuario:
function(){
return /iPad/.test(navigator.userAgent)?"t":/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent)?"m":"d";
} 

 

CriteoProductID

  • Tipo de variable: variable de la capa de datos
  • choose the name of the dataLayer variable you set for the product ID on the Product Page; in this example it is 'ProductID':
<script type="text/javascript">
dataLayer = dataLayer || [];
dataLayer.push({
'PageType': 'ProductPage',
'ProductID': 'ProductID'
});
</script>

CriteoProductIDList

  • Tipo de variable: variable de la capa de datos
  • choose the name of the dataLayer variable you set for the list of three product IDs on the Listing Page; in this example it is 'ProductIDList':
<script type="text/javascript">
dataLayer = dataLayer || [];
dataLayer.push({
'PageType':'ListingPage',
'ProductIDList' : ['ProductID_1', 'ProductID_2', 'ProductID_3']
});
</script>

CriteoPageType

  • Tipo de variable: variable de la capa de datos
  • choose the name of the dataLayer variable you set for the page type on each of your pages; in this example it is 'PageType':
<script type="text/javascript">
dataLayer = dataLayer || [];
dataLayer.push({
'PageType':'ListingPage',
'ProductIDList' : ['ProductID_1', 'ProductID_2', 'ProductID_3']
});
</script>

CriteoBasketProducts

  • Tipo de variable: variable de la capa de datos
  • choose the name of the dataLayer variable you set for the array of product information on the Basket Page; in this example it is 'ProductBasketProducts':
<script type="text/javascript">
var product_list = [];
product_list.push(
{ id: "productID_1", price: price_1, quantity: quantity_1 },
{ id: "productID_2", price: price_2, quantity: quantity_2 }
/* add a line for each item in the user's cart */
);
dataLayer = dataLayer || [];
dataLayer.push({
'PageType': 'BasketPage',
'ProductBasketProducts': product_list
});
</script>

CriteoTransProducts

  • Tipo de variable: variable de la capa de datos
  • choose the name of the dataLayer variable you set for the array of product information on the Sales Confirmation Page; in this example it is 'ProductTransactionProducts':
<script type="text/javascript">
var product_list = [];
product_list.push(
{ id: "productID_1", price: price_1, quantity: quantity_1 },
{ id: "productID_2", price: price_2, quantity: quantity_2 }
/* add a line for each item in the user's cart */
);
dataLayer = dataLayer || [];
dataLayer.push({
'PageType': 'TransactionPage',
'ProductTransactionProducts': product_list
});
</script>

TransactionID

  • Tipo de variable: variable de la capa de datos
  • choose the name of the dataLayer variable you set for the order number / transaction ID; in this example it is 'TransactionID':
<script type="text/javascript">
dataLayer = dataLayer || [];
dataLayer.push({
'PageType': 'TransactionPage',
'TransactionID': 'TransactionID'
});
</script>

¿Cuál es el siguiente paso?

Google Tag Manager now knows how to retrieve the data from your backend and format it accordingly. The next step consists in defining the scenarios our Criteo OneTag should be fired. This mechanism is called Triggers. Read more details in: Step 3: Triggers

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0
Tecnología de Zendesk