Adobe Target · updated

Adobe Target response tokens: what they are and how to read them

Response tokens are named values that Target adds to its answer, such as the activity name, the experience name or the visitor's country. You switch on the ones you want in Target's Administration screen, then read them in the page with an at.js custom event or from the Web SDK's sendEvent result. They are the supported way to pass Target details to other tools or to debug.

In plain words

When Target decides what a visitor sees, it can also tell the page which test and which version that was. Other tools, such as an analytics tool or a session recorder, can then record it. Nothing is sent to those tools by Target itself: your page code reads the values and passes them on.

Built-in tokens Adobe lists

GroupTokens
Built-in profilesprofile.activeActivities, profile.isFirstSession, profile.isNewSession, profile.daysSinceLastVisit, profile.tntId, profile.marketingCloudVisitorId, profile.thirdPartyId, profile.categoryAffinity, profile.categoryAffinities
Activityactivity.name, activity.id, experience.name, experience.id, offer.name, offer.id
Geogeo.country, geo.countryCode, geo.state, geo.city, geo.zip, geo.dma, geo.domainName, geo.ispName, geo.connectionSpeed, geo.mobileCarrier
Traffic allocation (Auto-Target and Automated Personalization only)experience.trafficAllocationId, experience.trafficAllocationType

User profile attributes and Customer Attributes also show in the list. Adobe notes that parameters with special characters do not display: only letters, digits and underscores are supported.

Version needs

  • at.js 1.1 or later.
  • Web SDK 2.6.0 or later. Adobe's FAQ on the same page says that on 2.6.0 or earlier you do not have access to response tokens, so use a version later than 2.6.0 to be safe.

How they arrive

With at.js, you listen for the adobe.target.event.REQUEST_SUCCEEDED custom event and read e.detail.responseTokens. With the Web SDK, the sendEvent command returns propositions; each proposition has items, and each item has a meta object filled with the response tokens that are switched on. Adobe says response tokens are delivered only through Target responses that deliver an activity, and that they also work in Preview mode.

Plug-ins and response tokens

Adobe contrasts the two: a plug-in delivers JavaScript that runs on the page, while response tokens deliver an object your own code reads. Adobe calls the response token approach safer and easier to maintain, encourages at.js customers to move away from plug-ins, and says plug-ins will be deprecated in the future.

at.js: read the tokens from the custom event Adobe documents

document.addEventListener(adobe.target.event.REQUEST_SUCCEEDED, function (e) {
  var tokens = e.detail.responseTokens;
  console.log(tokens);
});

Web SDK: read the tokens from the sendEvent result (each item's meta object)

alloy("sendEvent", { renderDecisions: true }).then(function (result) {
  (result.propositions || []).forEach(function (proposition) {
    (proposition.items || []).forEach(function (item) {
      console.log(item.meta);
    });
  });
});

How to switch them on

  1. Check the library version: at.js 1.1 or later, or a Web SDK version later than 2.6.0.
  2. In Target, open Administration > Response Tokens.
  3. Activate the tokens you need, such as activity.id and offer.id.
  4. If a profile parameter is not in the list yet, use Add Response Token, give the token name and activate it.
  5. Add the listener or read the sendEvent result in your page or tag manager, and pass the values to the other tool.
  6. Check the values in the network call or the browser console, including in Preview mode.

Related tools and pages on this site

Questions

Who can switch response tokens on or off?

Adobe's FAQ says only users with the Target Administrator role can activate or deactivate response tokens.

Why is my profile attribute missing from the list?

Adobe says Target normally refreshes parameters every 15 minutes and only when you view the response tokens page. Names with special characters are not shown at all.

Are tokens sent on every Target response?

No. Adobe says they are delivered only through responses that deliver an activity.

I renamed a profile script. Why does the old token still return values?

Adobe explains that tokens read what is saved in visitor profiles. Visitors who came before the change still have the old value saved.

Sources

Facts about Adobe's products on this page are from the linked Adobe pages, read on the date shown beside each. Explanations, steps and examples are ours unless marked as Adobe's. If Adobe's page and this one differ, Adobe's page is right.

Surge Migrate is not affiliated with Adobe and claims no Adobe partner status. Adobe product names are trademarks of Adobe.

Surge Migrate

Moving the website itself

This page answers one Adobe Target question. Surge Migrate moves a website from any CMS to any CMS. Converted automatically. Checked before you install.

  1. 1

    Scan

    Names the system behind your site, counts pages and templates, lists the blocks to build and the work no tool does, and gives an effort range with its working.

    Scan a site →
  2. 2

    Convert

    Each page becomes an Edge Delivery document, an AEM Core Component page and import files for 7 other systems. 10 pages free; 500 or 2,000 pages in one paid run.

    Convert your pages →
  3. 3

    Verify

    A download is offered only when its own format check passes. The report lists every field not found and every component kept as plain content. Compare old and new pages side by side.

    Parity check →
  4. 4

    Install

    You import with the target system's own tool, on your own environment. Each download's README gives the command. Your system changes only when you run it.

    How each import was tested →