[Premium]{class="badge positive" title="Consulte qué se incluye en Target Premium."}
Atributos de entidad personalizados custom-entity-attributes
En esta página: Aprenda a definir, enviar y utilizar atributos de entidad personalizados de uno o varios valores que describan los elementos del catálogo Adobe Target Recommendations.
Use atributos de entidad personalizados de uno o varios valores en Adobe Target Recommendations para definir información adicional sobre los elementos del catálogo. Esta información se puede utilizar en reglas de inclusión de algoritmos, reglas de catálogo y reglas de exclusión, y se puede mostrar en diseños de.
Límites limits
Puede incluir hasta 100 atributos de entidad personalizados para definir información adicional sobre los artículos de su catálogo. Por ejemplo, puede crear un atributo personalizado llamado entity.genre para definir un libro o una película. O un vendedor de entradas podría crear atributos del lugar de celebración para incluir un actor secundario, como un equipo visitante en un evento deportivo o un acto de apertura en un concierto.
La longitud máxima de los atributos personalizados de entidad de un solo valor es de 15 000 caracteres (para idiomas con codificación UTF-8 de uno y dos bytes, como inglés y otros alfabetos latinos) o 10 000 caracteres (para lenguajes con codificación UTF-8 de tres bytes, como chino, japonés y coreano).
Los atributos personalizados de entidad de varios valores no pueden contener más de 500 valores. Cada valor individual está limitado a 100 caracteres. El número total de caracteres en todos los valores debe cumplir las limitaciones de la longitud máxima de atributos personalizados de entidad de un solo valor (ver arriba).
Valores de atributo de entidad personalizados section_313331A9F8194A89B5EDD89363018651
Los atributos de entidad personalizados pueden contener uno o varios valores. Los valores de los atributos de entidad se muestran en la vista del producto.
Un atributo de entidad personalizado con un solo valor tiene el mismo formato que un atributo de entidad predefinido de un solo valor:
entity.genre=genre1
Un atributo de entidad personalizado con varios valores se debe enviar como una matriz de JSON válida:
entity.genre=["genre1", "genre2"]
Estos son ejemplos de matrices de JSON válidas compatibles con Recommendations:
["AB","BC"]todos los valores son cadenas[1,2]todos los valores son numéricos
["AB",1,true, [1,2,3]] es una matriz de JSON válida, pero Recommendations no la admite porque incluye una mezcla de tipos de valores (cadena, número, booleano, objeto).Cuando un atributo personalizado se envía como matriz de JSON válida, se trata como un atributo de varios valores en todos los productos del catálogo.
Restricciones:
- No se pueden usar nombres de atributos de entidad predefinidos para atributos de entidad personalizados. (Consulte Atributos de entidad).
- El atributo
entity.environmentse reserva para el sistema y no se puede usar en atributos de entidad personalizados. Se hará caso omiso de los intentos de pasarentity.environmentusandotargetPageParams, fuentes o API. - Las matrices deben contener un solo tipo de valor. Las matrices con valores mezclados (
["AB",1,true]) no se admiten. - Un atributo de varios valores que incluye una matriz de JSON anidada (
[10,12,[1,2,3]]) se trata como un atributo de un valor.
Implementación de atributos de varios valores section_80FEFE49E8AF415D99B739AA3CBA2A14
Los atributos de entidad personalizados de varios valores se admiten al usar fuentes (CSV), targetPageParams y la API de entrega para cargar productos. Los valores nuevos reemplazan a los actuales, no se adjuntan. Las matrices vacías ( []) se tratan como si no tuvieran valores.
Las comillas dobles se deben escapar. Por ejemplo, "[""test"", ""value""]" es una matriz JSON válida que se pueden usar en CSV.
Uso de targetPageParams
El siguiente ejemplo muestra cómo usar targetPageParams:
function targetPageParams() {
return {
'entity.id': '123',
'entity.categoryId': '["A", "A:B", "A:B:C", "A:B:C:D"]',
'entity.MultiValueAttribute': '["X", "Y", "Z"]',
'entity.event.detailsOnly': 'true',
'excludedIds': '[123, 3232, 2323, 4344]',
'orderId': '123456',
'orderTotal': '195.32',
'productPurchaseId': '[001,002,003]'
};
}
Uso del CSV
Puede administrar los archivos CSV sin procesar mediante un editor de texto o usar un programa de hojas de cálculo.
El CSV sin procesar tendrá este aspecto:
El mismo catálogo se verá del modo siguiente en una hoja de cálculo:
Al convertir al formato .csv, el programa de hojas de cálculo encierra entre comillas dobles el contenido de las celdas para evitar que las comas de la celda funcionen como separadores de columnas. También encierra entre comillas dobles los valores de las cadenas JSON que se incluyen en los atributos personalizados de varios valores. Esto puede hacer que trabajar directamente con el archivo sin procesar sea un poco complicado. Por ejemplo:
- Hoja de cálculo:
["1","2","3"] - Sin procesar:
"[""1"",""2"",""3""]"
Tenga cuidado al editar directamente un archivo CSV de catálogo sin procesar.
Uso de API
Puede pasar atributos de varios valores utilizando la API de entrega en un parámetro de mbox como un valor de cadena que contiene una matriz JSON de escape.
"execute": {
"mboxes": [
{
"index": 0,
"name": "first-mbox",
"parameters": {
"entity.id": "32323",
"entity.categoryId": "My Category",
"entity.MultiValueAttribute": "[\"X\", \"Y\", \"Z\"]"
}
}
]
}
Consulte la documentación de la API de Adobe Recommendations para obtener información sobre el uso de las API Entrega y Guardar entidades.
Uso de operadores con atributos de varios valores section_83C2288A805242D9A02EBC4F07DEE945
Al aplicar operadores a atributos personalizados de varios valores en reglas de inclusión de algoritmos, reglas de catálogo y reglas de exclusión, el resultado es true si al menos un valor de la lista cumple el criterio de la operación (booleano OR).
En el ejemplo siguiente, la regla es message contains abc.
- Caso 1:
entity.genre = ["ab", "bc", "de"]. El resultado es false porque ningún valor contieneabc. - Caso 2:
entity.genre = ["abcde","de","ef"]. El resultado es true porque un valor contieneabc.
En el caso de los operadores negativos, todos los valores de atributo deben cumplir el criterio (booleano AND). Por ejemplo, si el operador es notEquals, el resultado será false si algún valor coincide.
En la tabla siguiente se resume el comportamiento de cada operador y se proporcionan los casos de cada regla de ejemplo.
genre equals abc["ab", "bc", "de"]abc.["abc", "de", "ef"]abc.["abcde", "de", "ef"]abc no es igual a ningún elemento de la lista.genre not equals abc["ab", "bc", "de"]abc.["abc", "de", "ef"]abc.["abcde", "de", "ef"]abc no es igual a ningún elemento de la lista.genre contains abc["ab", "bc", "de"]abc.["abcde", "de", "ef"]abc.genre does not contain abc["ab", "bc", "de"]abc.["abcde", "de", "ef"]abc.genre starts with abc["ab", "bc", "de"]abc.["abcde", "de", "ef"]abc.["ab", "de", "abc"]abc (no necesariamente el primer elemento de la lista).genre ends with abc["ab", "bc", "de"]abc.["deabc", "de", "ef"]abc.price greater than or equal to 100["10", "20", "45", "de"]de se pasa por alto porque no se puede convertir en el doble.["100", "101", "90", "80"]price less than or equal to 100["101", "200", "141", "de"]de se pasa por alto porque no se puede convertir en el doble.["100", "101", "90", "80"]genre matches abc["ab", "bc", "de"]abc.["abc", "de", "ef"]abc.genre does not match abc["ab", "bc", "de"]abc.["abc", "de", "ef"]abc.price dynamically ranges in 80% to 120% of 100["101", "200", "125", "de"]101 está en el rango del 80% al 120% de 100. El valor de se pasa por alto porque no se puede convertir en el doble.["130", "191", "60", "75"]Atributos de varios valores en diseños section_F672E4F6E1D44B3196B7ADE89334ED4A
Los atributos de varios valores aparecen como una lista separada por comas cuando se hace referencia a ellos en un diseño.
Ejemplo:
Cuando se hace referencia a entity.genre=["genre1","genre2"] en un diseño como $entity<N>.genre, el resultado es genre1, genre2.
Temas relacionados
This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.
For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.
- TL;DR: Single- and multi-value custom entity attributes define additional information about items in the Adobe Target Recommendations catalog, and this page explains the limits, how to send them, and how operators and designs treat multiple values.
Intents:
- Define single-value and multi-value custom entity attributes for items in the catalog.
- Send a multi-value custom entity attribute as a valid JSON array.
- Implement multi-value attributes with feeds (CSV),
targetPageParams, or the Delivery API. - Predict the result of an operator applied to a multi-value custom attribute in algorithm inclusion rules, catalog rules, and exclusion rules.
- Display multi-value attributes in a design.
Glossary:
- Custom entity attribute (product-specific): an attribute that defines additional information about items in the catalog. It can be used in algorithm inclusion rules, catalog rules, and exclusion rules, and it can be displayed in designs.
- Single-value attribute: a custom entity attribute with one value, formed the same way as a single-value predefined entity attribute, for example
entity.genre=genre1. - Multi-value attribute: a custom entity attribute that contains several values and is sent as a valid JSON array, for example
entity.genre=["genre1", "genre2"]. - Double: a Java data type. For operators that require numeric values, converting to double eliminates non-numeric values from consideration in the results.
Guardrails:
- You can include up to 100 custom entity attributes.
- The maximum length of single-value entity custom attributes is 15,000 characters for one- and two-byte UTF-8 encoded languages such as English and other Latin-script alphabets, or 10,000 characters for three-byte UTF-8 encoded languages such as Chinese, Japanese and Korean.
- Multi-value entity custom attributes can contain no more than 500 values. Each individual value is limited to 100 characters. The total number of characters across all values must conform to the limitations for the maximum length of single-value entity custom attributes.
- A multi-value custom entity attribute must be sent as a valid JSON array.
- Recommendations does not support mixed value types in multi-value entity attributes. Arrays must contain a single value type. For example,
["AB",1,true]is not supported. - You cannot use predefined entity attribute names for custom entity attributes.
- The attribute
entity.environmentis reserved by the system and cannot be used for custom entity attributes. Attempts to passentity.environmentusingtargetPageParams, feeds, or APIs will be ignored. - After a custom attribute is sent as a valid JSON array, the attribute is treated as a multi-value attribute for all products in the catalog. To change an attribute from multi-value to single-value, you must delete your catalog and upload corrected product data. Deleting your catalog does not delete the historical data associated with your product IDs.
- When implementing multi-value attributes, double quotes must be escaped.
Applicability:
- Multi-value custom entity attributes are supported when using feeds (CSV),
targetPageParams, and the Delivery API to upload products. - The operators Dynamically matches, Dynamically does not match, and Dynamically ranges are only available in item-based algorithms.
- The operators Greater than or equal to, Less than or equal to, and Dynamically ranges apply to numeric values only.
Terminology:
- Canonical name: Custom entity attributes (the page also writes “custom attribute”, “entity custom attributes” and, for multi-value, “multi-valued custom attributes”).
- Product name: Adobe Target Recommendations (written “Recommendations” in the body).
- Variants: “single-value” and “multi-value” custom entity attributes.
FAQ:
- How do I send a multi-value custom entity attribute? Send it as a valid JSON array, for example
entity.genre=["genre1", "genre2"]. In a Delivery API mbox parameter, pass it as a string value containing an escaped JSON array. - What happens when I send new values for a multi-value attribute? New values replace current values; they are not appended. Empty arrays ( [] ) are treated as having no values.
- How does an operator work on a multi-value custom attribute? The result is true if at least one value in the list passes the operation (boolean or). For negative operators, all attribute values must pass (boolean and); for example, with the operator
notEquals, the result is false if any value matches. - What happens to values that cannot be converted to double? For operators that require numeric values, each value is converted to double, and values that cannot be converted are skipped while the rule runs.
- How does a multi-value attribute appear in a design? It appears as a comma-separated list when referenced in a design.
- Where are entity attribute values displayed? Entity attribute values are displayed in the product view.
Examples:
- Valid JSON arrays supported by Recommendations:
["AB","BC"](all values are strings) and[1,2](all values are numeric). targetPageParamsexample of sending a multi-value attribute:'entity.MultiValueAttribute': '["X", "Y", "Z"]'.- CSV example of a valid JSON array with escaped double quotes:
"[""test"", ""value""]". Spreadsheet software shows["1","2","3"], while the raw file shows"[""1"",""2"",""3""]". - Delivery API example of sending a multi-value attribute in an mbox parameter:
"entity.MultiValueAttribute": "[\"X\", \"Y\", \"Z\"]". - Rule
message contains abc: withentity.genre = ["ab", "bc", "de"]the result is false because no value containsabc; withentity.genre = ["abcde","de","ef"]the result is true because one value containsabc. - Rule
genre not equals abc: with["abc", "de", "ef"]the result is false because one value is equal toabc; with["ab", "bc", "de"]the result is true. - Rule
price greater than or equal to 100with["10", "20", "45", "de"]: the result is false, and the valuedeis skipped because it cannot be converted to double. - Design reference: when
entity.genre=["genre1","genre2"]is referenced in a design as$entity<N>.genre, the result isgenre1, genre2.
Best practices:
- Use caution when editing a raw catalog CSV file directly, because spreadsheet software adds double quotation marks around JSON string values in custom multi-value attributes, which can make working directly with the raw file unwieldy.
Related pages:
- Predefined entity attribute names that cannot be used for custom entity attributes: Entity Attributes (c-recommendations/c-products/entity-attributes.md)
Personas:
- developer: Can send multi-value custom entity attributes with feeds (CSV),
targetPageParams, and the Delivery API. With the Delivery API, they are passed in an mbox parameter as a string value containing an escaped JSON array. Double quotes must be escaped. The page states that new values replace current values and are not appended. Where: “Implementing multi-value attributes”. - marketer: Can apply operators to multi-valued custom attributes in algorithm inclusion rules, catalog rules, and exclusion rules, where the result is true if at least one value passes the operation. The page states that for negative operators, all attribute values must pass. Where: “Using operators with multi-value attributes”.
Onboarding:
- Level: Intermediate, Experienced
- First minimal step: Send a multi-value custom entity attribute as a valid JSON array, for example
entity.genre=["genre1", "genre2"]. - Previous: Check predefined entity attribute names that cannot be used for custom attributes: Entity Attributes (c-recommendations/c-products/entity-attributes.md)