Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Homework Assignment #2 Many tools in the toolbox

DavidSonPM
Employee
Employee

Hybrid Decisioning Method

 

When decisioningMethod = hybrid, we check every mbox and view in the request. If they all can be done locally, we execute locally. If any one of them is marked as being remote, we make a remote call. In other words, you are comfortable making remote calls when you have at least 1 mbox in the getOffers() call with decisioningMethod = hybrid. In the case of the VEC, for the target-global-mbox, if we detect that all activities that are on-device decisioning activities, then we will execute the decision locally. Otherwise, if you have a combination of on-device decisioning activities and remote activities (recommendations, AP, or AT) then we will always make a live server call for the decisioning.

  1. [Form-based composer] Create and activate 2 form-based composer AB activities with different mbox names for each. They are both supported via on-device decisioning.  Note: After creating and activating the new activities, it may take up to 5 minutes or more for the file that contains the activity to be generated and propagated to the Akamai edges. This is because we have a cron job set to monitor any new activities for on-device decisioning every 5 minutes.
  2. [VEC] Create and activate 2 A/B activities that qualify for on-device decisioningNote: After creating and activating the new activities, it may take up to 5 minutes or more for the file that contains the activity to be generated and propagated to the Akamai edges. This is because we have a cron job set to monitor any new activities for on-device decisioning every 5 minutes.
  3. Download at.js with On-device Decisioning (right click and "Save as...")
    By default, at.js is configured to always make a request to the target delivery API for each getOffers and target-global-mbox call. But you can configure it to use hybrid execution mode instead by setting the decisioningMethod setting. Specify the decisioningMethod in targetGlobalSettings.

 

 

 

 

 

 

window.targetGlobalSettings = {
    clientCode: "yourClientCodeHere",
    imsOrgId: "imsOrgId@AdobeOrg",
    decisioningMethod: "hybrid",
};

 

 

 

 

 

 

  • [VEC] Navigate to the page with the on-device decisioning enabled At.js and see your VEC AB activity render without a server call.
  • [Form-based composer] Call getOffers() for both mboxes without setting the decisioningMethod, and see that they are executed on-device.

 

 

 

 

 

 

adobe.target.getOffers({
    decisioningMethod: "hybrid",
    request: {
        execute: {
            mboxes: [
                { name: "local-decisioning-mbox", index: 0 },
                { name: "remote-decisioning-mbox", index: 1)
            ]
        }
    }
}).then(function(targetResponse) { });​

 

 

 

 

 

 

  • [VEC] Create and activate 1 A/B activity that qualify for on-device decisioning. Create and activate another A/B activity that does not qualify for on-device decisioning. For example, an A/B activity that uses user profile targeting or an Auto Allocate A/B activity. Note: After creating and activating the new activities, it may take up to 5 minutes or more for the file that contains the activity to be generated and propagated to the Akamai edges. This is because we have a cron job set to monitor any new activities for on-device decisioning every 5 minutes.
  • [VEC] Navigate to the page with the on-device decisioning-enabled At.js and see your VEC AB activity render with a server call since the decisioningMethod = hybrid and there is at least one activity that requires a server call.
  • [Form-based composer] Create and activate 2 form-based composer AB activities with different mbox names for each. Create ones that are not supported via on-device decisioning. For example, with user profile audience targeting. Note: After creating and activating the new activities, it may take up to 5 minutes or more for the file that contains the activity to be generated and propagated to the Akamai edges. This is because we have a cron job set to monitor any new activities for on-device decisioning every 5 minutes.
  • [Form-based composer] Call getOffers() for both mboxes, and see that they are executed with a remote call.
  • [Form-based composer] Now, create and activate 2 form-based composer AB activities with different mbox names for each. Create one that is supported via on-device decisioning and another that is not supported via on-device decisioning. Note: After creating and activating the new activities, it may take up to 5 minutes or more for the file that contains the activity to be generated and propagated to the Akamai edges. This is because we have a cron job set to monitor any new activities for on-device decisioning every 5 minutes.
  • [Form-based composer] Call getOffers() for both mboxes, and see that they are all executed with a remote call even though one of the mboxes is part of a on-device decisioning activity.

Feedback

  1. Do you have any use cases where you will use decisioningMethod = hybrid 
  2. [Form-based composer] Passing in decisioningMethod via targetGlobalSettings will apply this mode to all getOffers() call by default unless overridden. However, complications can arise in certain use cases. For example:
    1. If targetGlobalSettings is initialized with decisioningMethod = server-side and getOffers() with decisioningMethod = on-device is called, then there will be an error thrown.
    2. If targetGlobalSettings is initialized with decisioningMethod = server-side and getOffers() with decisioningMethod = hyrbid is called, then on-device decisioning activities will not be executed and erred out while the remote activities will be executed.
  3. Which use cases require you to run on-device decisioning and remote activities on the same page?

getAttributes()

adobe.target.getAttributes(mboxNames: Array<String>, options: Object): Promise is used to fetch JSON offers from Target and easily read attributes. It is especially useful as a feature flag mechanism. For instance, imagine a target AB activity (mbox name: featureFlags) with JSON offer content. Developers can find the JSON values within a getOffers response object, or alternatively, the getAttributes method can be used to simplify getting at those attribute values.

getattributes accepts the following parameters:

Name

Type

Required

Default

Description

mboxNames

Array

Yes

None

An array of mbox names

options

Object

No

None

The same options as used for getOffers


The Promise returned by adobe.target.getAttributes() resolves an object with the following methods:

Name

Return Type

Description

getValue(mboxName, key)

Any

Returns the value for a specified mbox name and attribute key

asObject(mboxName)

Object

Returns a simple json object with key value pairs

getResponse()

getOffers Response

Returns the response object normally returned by getOffers

 

  1. Try out this sample and get yourself familiarized with getAttributes() - https://github.com/jasonwaters/target-atjs-samples/tree/master/feature-flag
  2. Next, try using getAttributes() instead of getOffers() for your feature flagging use cases.

Feedback

  1. Do you run feature flagging use cases via the form-based composer frequently? If so, do you see yourself using getAttributes() more often than getOffers()?
  2. What kind of feedback do you have for us regarding getAttributes()? Do you have any other feature requests to support your feature flagging use cases?

A4T Reporting

  1. Install and load latest ECID library before At.js.
  2. Create and activate a on-device decisioning VEC or form-based composer activity.
  3. [Form-based composer] Make a getOffers() call with decisioningMethod=on-device for the mbox defined in the on-device decisioning activity.
  4. Verify that A4T reporting works correctly for the on-device decisioning activity when executed on your page.
  5. Note: A4T reporting should work the same way as it does today. On-device decisioning doesn't impact A4T reporting.
  6. Try out a performance test! Compare the performance between how fast experiences can be rendered with ECID library and Target via today's At.js vs. on-device decisioning-enabled At.js

Feedback

  1. Did you run into any issues with A4T reporting for on-device decisioning activities?
  2. What is the performance gains when comparing between today's At.js vs. on-device decisioning-enabled At.js for your web page? Please provide concrete numbers. Numbers around first page hit where the artifact needs to be downloaded and subsequent hits after the initial download of the artifact are most useful.

 

0 Replies