Trasmettere i dati dinamici nelle offerte pass-dynamic-data

In questa pagina: Scopri come visualizzare le informazioni su visitatori e attività nelle offerte con valori dinamici che Adobe Target sostituisce sul lato server.

Le offerte possono visualizzare le informazioni sui visitatori memorizzate nel profilo Adobe Target. Le informazioni sull’attività, come il nome dell’attività o dell’esperienza, possono essere utilizzate allo stesso modo. Una singola offerta restituisce quindi contenuti personalizzati in base agli interessi, al comportamento passato e al profilo complessivo di ogni visitatore.

Le preferenze, i comportamenti e lo stato di un visitatore possono essere memorizzati nel profilo, in modo che il messaggio possa essere ripetuto nelle visite successive. Anche le offerte dinamiche sono scalabili: una singola offerta all’interno di un’attività mostra messaggi personalizzati per tutti i visitatori. Quando l’intento di un visitatore cambia, il contenuto del sito web riflette automaticamente tali modifiche.

Casi aziendali

  • Promuovere un’offerta scontata per un acquisto relativo all’ultimo prodotto acquistato. Invece di un’offerta separata per ogni elemento del catalogo, un’offerta con testo dinamico legge “l’ultimo prodotto acquistato” dal profilo e visualizza un collegamento nell’offerta.
  • Un visitatore arriva sulla pagina di destinazione con keyword=world cup. Nell’offerta viene visualizzato il termine World cup.
  • Personalizza un’etichetta di consigli con informazioni quali (1) l’ultimo elemento aggiunto al carrello del visitatore (Nike Air Max 1000), (2) la preferenza di colore del visitatore (nero) e (3) la categoria non relativa alla scarpa preferita del visitatore (felpe). Esempio: “Abbina a “Nike Air Max 1000” queste fantastiche “felpe” “nere””.

Esempio

Con at.js 2.x, il parametro di profilo viene trasmesso nella richiesta di caricamento pagina con targetPageParams():

targetPageParams = function() {
  return {
    "profile.keyword": "World Cup"
  };
};

L’offerta utilizza quindi il parametro:

  • Codice offerta HTML: Get your ${profile.keyword} information here!
  • Testo mostrato al visitatore: Informazioni sui Mondiali di calcio

Valori disponibili per la sostituzione del token token-values

I seguenti valori possono essere sostituiti dal loro contenuto in un’offerta:

Valore
Esempi
Parametri di profilo in-mbox
${profile.age}
Parametri di profilo script
${user.lifetimeSpend}
Parametri mbox
${mbox.favoriteColor}
Informazioni sulla campagna
${campaign.name}, ${campaign.recipe.name}, ${campaign.id}, ${campaign.recipe.id}, e ${campaign.recipe.trafficType}
ID visitatore univoco
${user.pcId}
ID di sessione univoco
${user.sessionId}
Prima sessione del visitatore (true o false)
${user.isFirstSession}
Comportamento passato
${user.endpoint.lastPurchasedEntity}, ${user.endpoint.lastViewedEntity}, ${user.endpoint.mostViewedEntity}, ${user.endpoint.categoryAffinity}

Ai fini del debug, è possibile registrare nella console informazioni quali ${campaign.name}, ${campaign.id}, ${campaign.recipe.name}, ${campaign.recipe.id}, ${offer.name} e ${offer.id}.

Per le progettazioni di Recommendations, vedere gli esempi aggiuntivi in Panoramica progettazione.

Implementazione

I parametri di profilo trasmessi in una mbox utilizzano la seguente sintassi:

${profile.parameter}

I parametri di profilo creati in uno script di profilo utilizzano la seguente sintassi:

${user.parameter}

In una progettazione Recommendations, un attributo dinamico viene eseguito correttamente solo con una barra rovesciata ( \ ) prima del simbolo del dollaro ( $ ):

\${user.endpoint.lastViewedEntity}

Poiché queste variabili vengono sostituite con il relativo valore sul lato server, la visualizzazione non richiede virgolette o altri tipi di JavaScript.

Anche i valori esposti alle offerte possono avere un valore predefinito, con la seguente sintassi:

${user.testAttribute default="All Items!"}

Se testAttribute non esiste o è vuoto, verrà visualizzato il messaggio “All Items!” è scritto. Quando un valore di attributo vuoto è valido e deve essere scritto al posto del valore predefinito, utilizza:

${user.testAttribute default="All Items!" show_blank="true"}

I valori visualizzati possono anche essere preceduti e seguiti da un carattere di escape. Ad esempio, un valore con un apostrofo può essere escluso in modo che non interrompa il JavaScript sulla pagina: le offerte sono scritte in JavaScript, quindi un singolo apostrofo può essere confuso con una virgoletta. Ad esempio:

${user.encodedValue encode="unescape"}
${user.unencodedValue encode="escape"}

I parametri dell’offerta (offer.name, offer.id) utilizzati nel contenuto di un’offerta vengono valutati a livello di esperienza. Quando l’offerta è una delle diverse offerte impostate su un’esperienza, il parametro assume il valore dell’ultima offerta aggiunta.

AI Knowledge Reference

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: Explains how to pass dynamic data, such as visitor information stored in the Adobe Target profile and activity information, into offers so that a single offer returns personalized content.

Intents:

  • Display visitor information that is stored in the Adobe Target profile in an offer.
  • Use activity information, such as the name of the activity or the name of the experience, in an offer.
  • Find which values can be “token replaced” and the syntax of each.
  • Specify a default value for a value exposed to offers.
  • Escape or unescape a value displayed in an offer.
  • Use dynamic attributes in a Recommendations design.

Glossary:

  • In-mbox profile parameters (product-specific): profile parameters passed into an mbox, written ${profile.parameter}.
  • Script profile parameters (product-specific): profile parameters created in a profile script, written ${user.parameter}.

Guardrails:

  • In a Recommendations design, a backslash must be inserted before the dollar sign for the dynamic value to render properly, for example \${user.endpoint.lastViewedEntity}.

FAQ:

  • Which values can be “token replaced”? In-mbox profile parameters, script profile parameters, mbox parameters, campaign information, the unique visitor id, the unique session id, whether it is the visitor’s first session (true or false), and past behavior.
  • Do quotes or other JavaScript need to be added for the value to display? No. These variables are replaced with the value on the server side, so no quotes or other JavaScript is required for the proper display.
  • What is written out when an attribute does not exist or is blank? The default value, when one is specified with ${user.testAttribute default="All Items!"}; in that example, “All Items!” is written out.
  • How can an empty attribute value be written out instead of the default? When an empty attribute value is valid, use ${user.testAttribute default="All Items!" show_blank="true"}.
  • Which value populates an offer parameter such as offer.name or offer.id when the offer is one of several offers set on an experience? The value of the last added offer populates the parameter’s value, because these parameters are evaluated on the experience level.

Examples:

  • Business case: promote a discounted offer to “refill” or “replenish” the last product purchased, with one offer that has dynamic text that reads the “last product purchased” from the profile and displays a link in the offer, instead of a separate offer for every item in the catalog.
  • Business case: a visitor arrives on a landing page with keyword=world cup, and the term World cup is displayed in the offer.
  • Business case: personalize a recommendations label with the last item added to a visitor’s cart (Nike Air Max 1000s), the visitor’s color preference (black) and the visitor’s favorite non-shoe category (hoodies), for example “Accessorize your ‘Nike Air Max 1000s’ with these cool ‘black’ ‘hoodies’!”
  • Passing a profile parameter into an offer: mboxCreate("landingpage", "profile.keyword=World Cup"); with the HTML Offer code Get your ${profile.keyword} information here!, so that the visitor sees “Get your World Cup information here!”.
  • Token replacement values and their examples: in-mbox profile parameters ${profile.age}; script profile parameters ${user.lifetimeSpend}; mbox parameters ${mbox.favoriteColor}; campaign information ${campaign.name}, ${campaign.recipe.name}, ${campaign.id}, ${campaign.recipe.id} and ${campaign.recipe.trafficType}; unique visitor id ${user.pcId}; unique session id ${user.sessionId}; visitor’s first session (true or false) ${user.isFirstSession}; past behavior ${user.endpoint.lastPurchasedEntity}, ${user.endpoint.lastViewedEntity}, ${user.endpoint.mostViewedEntity} and ${user.endpoint.categoryAffinity}.
  • Debugging: log information in the console for debugging purposes, such as ${campaign.name}, ${campaign.id}, ${campaign.recipe.name}, ${campaign.recipe.id}, ${offer.name} and ${offer.id}.
  • Default value: ${user.testAttribute default="All Items!"}, so that “All Items!” is written out when testAttribute does not exist or is blank.
  • Default value with a blank value: ${user.testAttribute default="All Items!" show_blank="true"}, for when an empty attribute value is valid and is to be written out instead of showing the default.
  • Escape and unescape: ${user.encodedValue encode="unescape"} and ${user.unencodedValue encode="escape"}, for example to escape a value that has an apostrophe so it does not break the JavaScript on the page (offers are written in JavaScript, so a single apostrophe can be confused for a quote).

Related pages:

  • For additional examples for Recommendations designs: Design Overview (c-recommendations/c-design-overview/design-overview.md)

Personas:

  • marketer: Can create one offer with dynamic text that reads the “last product purchased” from the profile and displays a link in the offer, instead of a separate offer for every item in the catalog. Can display the term World cup in the offer when a visitor arrives on a landing page with keyword=world cup. Can personalize a recommendations label with information, such as the last item added to a visitor’s cart, the visitor’s color preference and the visitor’s favorite non-shoe category. Where: “Business cases”.
  • developer: Can use the syntax ${profile.parameter} for profile parameters passed into an mbox and ${user.parameter} for profile parameters created in a profile script. Can specify a default value with ${user.testAttribute default="All Items!"} and, when an empty attribute value is valid, write it out instead of the default with ${user.testAttribute default="All Items!" show_blank="true"}. Can escape and unescape values with encode="escape" and encode="unescape". The page states that in a Recommendations design, a backslash must be inserted before the dollar sign for the dynamic value to render properly. Where: “Implementation”.

Onboarding:

  • Level: Intermediate
  • First minimal step: Pass a profile parameter into an mbox, such as profile.keyword=World Cup, and use ${profile.keyword} in the HTML offer code.
  • Success check: The visitor sees “Get your World Cup information here!” for the HTML offer code Get your ${profile.keyword} information here!.
  • Next: See additional examples for Recommendations designs: Design Overview (c-recommendations/c-design-overview/design-overview.md)
recommendation-more-help
target-help-main