Edit in GitHubLog an issue

Troubleshooting

Validating Configuration#

Summary of Steps#

  1. Ensure the logger is configured
  2. Ensure Target Traces is enabled
  3. Verify the on-device decisioning rule artifact has been retrieved and cached according to the polling interval defined.
  4. Validate content delivery via the cached rule artifact by creating a test on-device decisioning activity through the form-based experience composer.

Ensure the logger is configured#

When initializing the SDK, ensure that you enable logging.

Node.js

For Node.js SDK a logger object should be provided.

Copied to your clipboard
1const CONFIG = {
2 client: "<your client code>",
3 organizationId: "<your organization ID>",
4 logger: console
5};

Java SDK

For Java SDK logRequests on the ClientConfig should be enabled.

Copied to your clipboard
1ClientConfig config = ClientConfig.builder()
2 .client("<your client code>")
3 .organizationId("<your organization ID>")
4 .logRequests(true)
5 .build();

Also the JVM should be started with the following command line parameter:

Copied to your clipboard
$ java -Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG ...

Ensure Target Traces is enabled#

Enabling traces will output additional information from Adobe Target in regards to the rules artifact.

  1. Navigate to the Target UI in Experience Cloud.

    alt image

  2. Navigate to Administration > Implementation and click Generate New Authorization Token.

    alt image

  3. Copy the newly generated authorization token to the clipboard and add it to your Target request:

Node.js

Copied to your clipboard
1const request = {
2 trace: {
3 authorizationToken: "88f1a924-6bc5-4836-8560-2f9c86aeb36b"
4 },
5 execute: {
6 mboxes: [{
7 name: "sdk-mbox"
8 }]
9}};

Java SDK

Copied to your clipboard
1Trace trace = new Trace()
2 .authorizationToken("88f1a924-6bc5-4836-8560-2f9c86aeb36b");
3Context context = new Context()
4 .channel(ChannelType.WEB);
5MboxRequest mbox = new MboxRequest()
6 .name("sdk-mbox")
7 .index(0);
8ExecuteRequest executeRequest = new ExecuteRequest()
9 .mboxes(Arrays.asList(mbox));
10
11TargetDeliveryRequest request = TargetDeliveryRequest.builder()
12 .trace(trace)
13 .context(context)
14 .execute(executeRequest)
15 .build();
  1. With the logger and trace in place, start your app and monitor the server terminal. The following output from the logger confirms that the rule artifact has been retrieved:

Node.js SDK

Copied to your clipboard
1 AT: LD.ArtifactProvider fetching artifact - https://assets.adobetarget.com/your-client-code/production/v1/rules.json
2 AT: LD.ArtifactProvider artifact received - status=200
  1. Wait the duration of the polling interval (default is 5 minutes) and ensure that the artifact is being fetched by the SDK. The same terminal logs will be output.

    Additionally, information from the the Target Trace should be outputted to the terminal with details about the rule artifact.

Copied to your clipboard
1"trace": {
2 "clientCode": "your-client-code",
3 "artifact": {
4 "artifactLocation": "https://assets.adobetarget.com/your-client-code/production/v1/rules.json",
5 "pollingInterval": 300000,
6 "pollingHalted": false,
7 "artifactVersion": "1.0.0",
8 "artifactRetrievalCount": 10,
9 "artifactLastRetrieved": "2020-09-20T00:09:42.707Z",
10 "clientCode": "your-client-code",
11 "environment": "production",
12 "generatedAt": "2020-09-22T17:17:59.783Z"
13 },

Validate content delivery via the cached rule artifact by creating a test on-device decisioning activity through the form-based experience composer.#

  1. Navigate to the Target UI in Experience Cloud

    alt image

  2. Create a new XT activity using the Form-based Experience Composer.

    alt image

  3. Input the mbox name used in your Target request as the location for the XT activity (note this should be a unique mbox name specifically for development purposes).

    alt image

  4. Change the content to either an HTML offer or JSON offer. This will be returned in the Target request to your application. Leave targeting for the activity as 'All Visitors' and select any metric you would like. Name the activity, save it, and then activate it to ensure the mbox/location in use is only for development.

    alt image

  5. In your application, add a log statements for the content received in the response from your Target request

Node.js SDK

Copied to your clipboard
1try {
2 const response = await targetClient.getOffers({ request });
3 console.log('Response: ', response.response.execute.mboxes[0].options[0].content);
4} catch (error) {
5 console.error('Something went wrong', error);
6}

Java SDK

Copied to your clipboard
1try {
2 Context context = new Context()
3 .channel(ChannelType.WEB);
4 MboxRequest mbox = new MboxRequest()
5 .name("sdk-mbox")
6 .index(0);
7 ExecuteRequest executeRequest = new ExecuteRequest()
8 .mboxes(Arrays.asList(mbox));
9
10 TargetDeliveryRequest request = TargetDeliveryRequest.builder()
11 .context(context)
12 .decisioningMethod(DecisioningMethod.ON_DEVICE)
13 .execute(executeRequest)
14 .build();
15
16 TargetDeliveryResponse response = targetClient.getOffers(request);
17 logger.debug("Response: ", response.getResponse().getExecute().getMboxes().get(0).getOptions().get(0).getContent());
18} catch (Exception exception) {
19 logger.error("Something went wrong", exception);
20}
  1. Review the logs in your terminal to verify that your content is being delivered and that it was delivered via the rules artifact on your server. The LD.DeciscionProvider object is outputted when the activity qualification and decisioning were determined on-device based on the rules artifact. Furthermore, due to the logging of the content, you should see <div>test</div> or however you have decided the response to be when creating the test activity.

Logger output

Copied to your clipboard
1AT: LD.DecisionProvider {...}
2AT: Response received {...}
3Response: <div>test</div>

Common Troubleshooting Scenarios#

On-device decisioning activities not executing due to unsupported audience or activity#

A common issue that can occur is on-device decisioning activities not executing due to the audience in use or the activity type being unsupported.

(1) Using the logger output, review the entries in the trace property in your response object. Specifically identify the campaigns property:

Trace output

Copied to your clipboard
1 "execute": {
2 "mboxes": [
3 {
4 "name": "your-mbox-name",
5 "index": 0,
6 "trace": {
7 "clientCode": "your-client-code",
8 ...
9 "campaigns": [],
10 ...
11 }
12 }

You will notice that the activity you are trying to qualify for is not in the campaigns property since the audience or activity type is not supported. If the activity is listed under the campaigns property, your issue is not due to an unsupported audience or activity type.

(2) Additionally, locate the rules.json file by looking at the trace > artifact > artifactLocation in your logger output and notice that your activity is missing from the rules > mboxes property:

Logger output

Copied to your clipboard
1 ...
2 rules: {
3 mboxes: { },
4 views: { }
5 }

Finally, navigate to the Target UI and locate the activity in question: experience.adobe.com/target

Review the rules used in the audience and ensure you only use those aforementioned that are supported. Additionally, ensure that the activity type is either A/B or XT.

alt image

On-device decisioning activities not executing due to unqualified audience#

If an on-device decisioning activity is not executing, but you have verified that your rules.json file contains the activity, run through the following steps:

(1) Ensure that the mbox you are executing in your application is the same one the activity is using:

rules.json

Copied to your clipboard
1 ...
2 rules: {
3 mboxes: {
4 target-only-node-sdk-mbox: [{ // this mbox name must match the mbox in your request
5 ...
6 }]
7 }
8 ...

Node.js SDK

Copied to your clipboard
1const request = {
2 trace: {
3 authorizationToken: '2dfc1dce-1e58-4e05-bbd6-a6725893d4d6'
4 },
5 execute: {
6 mboxes: [{
7 address: getAddress(req),
8 name: "target-only-node-sdk-mbox-two" // this mbox name must match the mbox the activity is using
9 }]
10 }};

Java SDK

Copied to your clipboard
1Context context = new Context()
2 .channel(ChannelType.WEB);
3MboxRequest mbox = new MboxRequest()
4 .name("target-only-node-sdk-mbox-two")
5 .index(0);
6ExecuteRequest executeRequest = new ExecuteRequest()
7 .mboxes(Arrays.asList(mbox));
8
9TargetDeliveryRequest request = TargetDeliveryRequest.builder()
10 .context(context)
11 .decisioningMethod(DecisioningMethod.ON_DEVICE)
12 .execute(executeRequest)
13 .build();
14
15TargetDeliveryResponse response = targetClient.getOffers(request);

(2) Ensure that you are qualified for the audience for you activity by reviewing the matchedRuleConditions or unmatchedRuleConditions property of your trace output:

Trace output

Copied to your clipboard
1...
2},
3"campaignId": 368564,
4"campaignType": "landing",
5"matchedSegmentIds": [],
6"unmatchedSegmentIds": [
7 6188838
8 ],
9 "matchedRuleConditions": [],
10 "unmatchedRuleConditions": [
11 {
12 "in": [
13 "true",
14 {
15 "var": "mbox.auth_lc"
16 }
17 ]
18 }
19 ]
20 ...

If you have unmatched rule conditions, you are not qualified for the activity and thus the activity will not execute. Review the rules in your audience to see why you are not qualifying.

On-device decisioning activity not executing, but reason not apparent#

It may not be readily apparent why an on-device decisioning activity is not executing. In this case, follow these troubleshooting steps to identify the issue:

(1) Read through the logger trace output in your console and identify the artifact property, which will look similar to the following:

Trace output

Copied to your clipboard
1...
2 "artifact": {
3 "artifactLocation": "https://assets.adobetarget.com/your-client-code/production/v1/rules.json",
4 "pollingInterval": 300000,
5 "pollingHalted": false,
6 "artifactVersion": "1.0.0",
7 "artifactRetrievalCount": 3,
8 "artifactLastRetrieved": "2020-10-16T00:56:27.596Z",
9 "clientCode": "adobeinterikleisch",
10 "environment": "production"
11 },
12...

Look at the artifactLastRetrieved date of the artifact and ensure that you have the latest rules.json file downloaded to your app.

(2) Find the evaluatedCampaignTargets property in your logger output:

Logger output

Copied to your clipboard
1...
2 "evaluatedCampaignTargets": [
3 {
4 "context": {
5 "current_timestamp": 1602812599608,
6 "current_time": "0143",
7 "current_day": 5,
8 "user": {
9 "browserType": "unknown",
10 "platform": "Unknown",
11 "locale": "en",
12 "browserVersion": -1
13 },
14 "page": {
15 "url": "localhost:3000/",
16 "path": "/",
17 "query": "",
18 "fragment": "",
19 "subdomain": "",
20 "domain": "3000",
21 "topLevelDomain": "",
22 "url_lc": "localhost:3000/",
23 "path_lc": "/",
24 "query_lc": "",
25 "fragment_lc": "",
26 "subdomain_lc": "",
27 "domain_lc": "3000",
28 "topLevelDomain_lc": ""
29 },
30 "referring": {
31 "url": "localhost:3000/",
32 "path": "/",
33 "query": "",
34 "fragment": "",
35 "subdomain": "",
36 "domain": "3000",
37 "topLevelDomain": "",
38 "url_lc": "localhost:3000/",
39 "path_lc": "/",
40 "query_lc": "",
41 "fragment_lc": "",
42 "subdomain_lc": "",
43 "domain_lc": "3000",
44 "topLevelDomain_lc": ""
45 },
46 "geo": {},
47 "mbox": {},
48 "allocation": 23.79
49 },
50 "campaignId": 368564,
51 "campaignType": "landing",
52 "matchedSegmentIds": [],
53 "unmatchedSegmentIds": [
54 6188838
55 ],
56 "matchedRuleConditions": [],
57 "unmatchedRuleConditions": [
58 {
59 "in": [
60 "true",
61 {
62 "var": "mbox.auth_lc"
63 }
64 ]
65 }
66 ]
67...

(3) Review the context, page, and referring data to ensure it is as expected as this can affect the targeting qualification of the activity.

(4) Review the campaignId to ensure the activity or activities you are expecting to execute are evaluated. The campaignId will match the activity ID on the activity overview tab in the Target UI:

alt image

(5) Review the matchedRuleConditions and unmatchedRuleConditions to identify issues with qualifying for the audience rules for a given activity.

(6) Review the latest rules.json file to ensure the activity or activities you want to execute locally are included. The location is referenced above in step 1.

(7) Ensure you are using the same mbox names in your request and activities.

(8) Ensure you are using supported audience rules and supported activity types.

Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.