ÃÛ¶¹ÊÓÆµ

Analytics for Target (A4T) reporting

ÃÛ¶¹ÊÓÆµ Target supports A4T reporting for both on-device decisioning and server-side Target activities. There are two configuration options for enabling A4T reporting:

  • ÃÛ¶¹ÊÓÆµ Target automatically forwards the analytics payload to ÃÛ¶¹ÊÓÆµ Analytics, or
  • The user requests the analytics payload from ÃÛ¶¹ÊÓÆµ Target. (ÃÛ¶¹ÊÓÆµ Target returns the ÃÛ¶¹ÊÓÆµ Analytics payload back to the caller.)
NOTE
On-device decisioning only supports A4T reporting of which ÃÛ¶¹ÊÓÆµ Target automatically forwards the analytics payload to ÃÛ¶¹ÊÓÆµ Analytics. Retrieving the analytics payload from ÃÛ¶¹ÊÓÆµ Target is not supported.

Pre-requisites

  1. Configure the activity in the ÃÛ¶¹ÊÓÆµ Target UI with ÃÛ¶¹ÊÓÆµ Analytics as the reporting source, and ensure the accounts are enabled for A4T.
  2. The API user generates the ÃÛ¶¹ÊÓÆµ Marketing Cloud Visitor ID and ensures this ID is available when the Target request is executed.

ÃÛ¶¹ÊÓÆµ Target automatically forwards the Analytics payload

ÃÛ¶¹ÊÓÆµ Target can automatically forward the analytics payload to ÃÛ¶¹ÊÓÆµ Analytics if the following identifiers are provided:

  1. supplementalDataId: The ID that is utilized to stitch between ÃÛ¶¹ÊÓÆµ Analytics and ÃÛ¶¹ÊÓÆµ Target. In order for ÃÛ¶¹ÊÓÆµ Target and ÃÛ¶¹ÊÓÆµ Analytics to correctly stitch data together, the same supplementalDataId needs to be passed to both ÃÛ¶¹ÊÓÆµ Target and ÃÛ¶¹ÊÓÆµ Analytics.
  2. trackingServer: The ÃÛ¶¹ÊÓÆµ Analytics Server.
Node.js
code language-js line-numbers
const TargetClient = require("@adobe/target-nodejs-sdk");

const CONFIG = {
  client: "acmeclient",
  organizationId: "1234567890@ÃÛ¶¹ÊÓÆµOrg"
};

const targetClient = TargetClient.create(CONFIG);

targetClient.getOffers({
  request: {
    id: {
      marketingCloudVisitorId : "2304820394812039",
      tntId: "d359234570e044f14e1faeeba02d6ab23439914e.35_0",
      thirdPartyId:"23423432"
    },
    experienceCloud: {
      analytics: {
        logging: "server_side",
        supplementalDataId: "7D3AA246CC99FD7F-1B3DD2E75595498E",
        trackingServer: "jimsbrims.sc.omtrds.net"
      }
    },
    execute: {
      mboxes: [{
        name: "some-mbox"
      }]
    }
  }
})
.then(console.log)
.catch(console.error);
Java
code language-java line-numbers
ClientConfig config = ClientConfig.builder()
  .client("acmeclient")
  .organizationId("1234567890@ÃÛ¶¹ÊÓÆµOrg")
  .build();
TargetClient targetClient = TargetClient.create(config);

VisitorId id = new VisitorId()
  .tntId("d359234570e044f14e1faeeba02d6ab23439914e.35_0")
  .thirdPartyId("B234A029348")
  .marketingCloudVisitorId("10527837386392355901041112038610706884");
Context context = new Context().channel(ChannelType.WEB);
MboxRequest mbox = new MboxRequest()
  .name("some-mbox")
  .index(0);
ExecuteRequest executeRequest = new ExecuteRequest()
  .mboxes(Arrays.asList(mbox));

AnalyticsRequest analyticsRequest =
    new AnalyticsRequest()
        .trackingServer("jimsbrims.sc.omtrds.net")
        .logging(LoggingType.SERVER_SIDE)
        .supplementalDataId("7D3AA246CC99FD7F-1B3DD2E75595498E");
ExperienceCloud expCloud =
    new ExperienceCloud()
        .setAnalytics(analyticsRequest);

TargetDeliveryRequest request = TargetDeliveryRequest.builder()
  .context(context)
  .execute(executeRequest)
  .experienceCloud(expCloud)
  .build();

TargetDeliveryResponse offers = targetClient.getOffers(request);

User retrieves analytics payload from ÃÛ¶¹ÊÓÆµ Target

A user can retrieve the ÃÛ¶¹ÊÓÆµ Analytics payload for a given mbox, then send it to ÃÛ¶¹ÊÓÆµ Analytics via the . When an ÃÛ¶¹ÊÓÆµ Target request is fired, pass client_side to the logging field in the request. This request returns a payload if the specified mbox is present in an activity that is using Analytics as the reporting source.

Node.js
code language-js line-numbers
const TargetClient = require("@adobe/target-nodejs-sdk");
const CONFIG = {
  client: "acmeclient",
  organizationId: "1234567890@ÃÛ¶¹ÊÓÆµOrg"
};
const targetClient = TargetClient.create(CONFIG);
targetClient.getOffers({
  request: {
    id: {
      marketingCloudVisitorId : "2304820394812039",
      tntId: "d359234570e044f14e1faeeba02d6ab23439914e.35_0",
      thirdPartyId:"23423432"
    },
    experienceCloud: {
      analytics: {
        logging: "client_side"
      }
    },
    execute: {
      mboxes: [{
        name: "some-mbox"
      }]
    }
  }
})
.then(console.log)
.catch(console.error);
Java
code language-java line-numbers
ClientConfig config = ClientConfig.builder()
  .client("acmeclient")
  .organizationId("1234567890@ÃÛ¶¹ÊÓÆµOrg")
  .build();
TargetClient targetClient = TargetClient.create(config);

VisitorId id = new VisitorId()
  .tntId("d359234570e044f14e1faeeba02d6ab23439914e.35_0")
  .thirdPartyId("B234A029348")
  .marketingCloudVisitorId("10527837386392355901041112038610706884");
Context context = new Context().channel(ChannelType.WEB);
MboxRequest mbox = new MboxRequest()
  .name("some-mbox")
  .index(0);
ExecuteRequest executeRequest = new ExecuteRequest()
  .mboxes(Arrays.asList(mbox));

AnalyticsRequest analyticsRequest =
    new AnalyticsRequest()
        .logging(LoggingType.CLIENT_SIDE);
ExperienceCloud expCloud =
    new ExperienceCloud()
        .setAnalytics(analyticsRequest);

TargetDeliveryRequest request = TargetDeliveryRequest.builder()
  .context(context)
  .execute(executeRequest)
  .experienceCloud(expCloud)
  .build();

TargetDeliveryResponse offers = targetClient.getOffers(request);

Once you have specified logging = client_side, you will receive the payload in the mbox field.

If the response from Target contains anything in the analytics -> payload property, forward it as it is to ÃÛ¶¹ÊÓÆµ Analytics. ÃÛ¶¹ÊÓÆµ Analytics knows how to process this payload. This can be done in a GET request using the following format:

https://{datacollectionhost.sc.omtrdc.net}/b/ss/{rsid}/{content_type_num}/{code_ver}/{session}?pe=tnt&tnta={payload}&c.&a.&target.&sessionId={sessionId}&.target&.a&.c&mid={mid}

Query string parameters and variables

Field Name
Required
Description
rsid
Yes
The report suite ID
content_type_num
Yes
Always set to “0â€
code_ver
Yes
Always set to “MOBILE-1.0â€
session
Yes
Always set to “0â€
pe
Yes
Page event. Always set to tnt
tnta
Yes
Analytics payload returned by Target server in analytics -> payload -> tnta
sessionId
Yes
Target session Id of the ongoing session
mid
Yes
Marketing Cloud Visitor ID

Required header values

Header Name
Header Value
Host
Analytics data collection server (eg: adobeags421.sc.omtrdc.net)

Sample A4T data insertion HTTP Get call

Non-URL-encoded version For Readability (format not to be used for API calls):

https://demo.sc.omtrdc.net/b/ss/myCustomRsid/0/MOBILE-1.0/0?tnta=253236:0:0|0,253236:0:0|2,253236:0:0|1,253613:0:0|0,253613:0:0|2,253613:0:0|1&c.&a.&target.&sessionId=45c08980-f4b9-4e11-96db-067d58e49f74&.target&.a&.c&pe=tnt&mid=69170113867710665996968872592584719577

URL-encoded version (format to be used for API calls):

https://demo.sc.omtrdc.net/b/ss/myCustomRsid/0/MOBILE-1.0/0?tnta=253236%3A0%3A0%7C0%2C253236%3A0%3A0%7C2%2C253236%3A0%3A0%7C1%2C253613%3A0%3A0%7C0%2C253613%3A0%3A0%7C2%2C253613%3A0%3A0%7C1&c.%26a.%26target.%26sessionId=45c08980-f4b9-4e11-96db-067d58e49f74%26.target%26.a%26.c&pe=tnt&mid=69170113867710665996968872592584719577
recommendation-more-help
6906415f-169c-422b-89d3-7118e147c4e3