Getting Started with Target SDKs
In order to get up and running, we encourage you to create your first on-device decisioning feature flag activity in the language of your choice:
- Node.js
- Java
- .NET
- Python
Summary of steps
- Enable on-device decisioning for your organization
- Install the SDK
- Initialize the SDK
- Set up the feature flags in an Adobe Target A/B Test activity
- Implement and render the feature in your application
- Implement tracking for events in your application
- Activate your A/B Test activity
1. Enable on-device decisioning for your organization
Enabling on-device decisioning ensures an A/B Test activity is executed at near-zero latency. To enable this feature, navigate to Administration > Implementation > Account details and enable the On-Device Decisioning toggle.
After enabling the On-Device Decisioning toggle, Adobe Target begins generating rule artifacts for your client.
2. Install the SDK
For Node.js, Java, and Python, run the following command in your project directory in the terminal. For .NET, add it as a dependency by installing from NuGet.
code language-js line-numbers |
---|
|
code language-javascript line-numbers |
---|
|
code language-bash line-numbers |
---|
|
code language-python line-numbers |
---|
|
3. Initialize the SDK
The rule artifact is downloaded during the SDK initialization step. You can customize the initialization step to determine how the artifact is downloaded and used.
code language-js line-numbers |
---|
|
code language-javascript line-numbers |
---|
|
code language-csharp line-numbers |
---|
|
code language-python line-numbers |
---|
|
4. Set up the feature flags in an Adobe Target A/B Test activity
-
In Target, navigate to the Activities page, then select Create Activity > A/B test.
-
In the Create A/B Test Activity modal, leave the default Web option selected (1), select Form as your experience composer (2), select Default Workspace with No Property Restrictions(3), then click Next (4).
-
In the Experiences step of activity creation, provide a name for your activity (1) and add a second experience, Experience B, by clicking Add Experience (2). Enter the location name of your choice (3). For example,
ondevice-featureflag
orhomepage-addtocart-featureflag
are location names indicating the destinations for feature flag testing. In the example shown below,ondevice-featureflag
is the location defined for Experience B. Optionally, you may add Audience Refinements (4) to restrict qualification to the activity. -
In the CONTENT section on the same page, select Create JSON Offer in the drop-down (1) as shown.
-
In the JSON Data text box that appears, type your feature flag variables for each experience (1), using a valid JSON object (2).
Enter the feature flag variables for Experience A.
(Sample JSON for Experience A, above)
code language-json line-numbers { "enabled" : true, "flag" : "expA" }
Enter the feature flag variables for Experience B.
(Sample JSON for Experience B, above)
code language-json line-numbers { "enabled" : true, "flag" : "expB" }
-
Click Next (1) to advance to the Targeting step of activity creation.
-
In the Targeting step example shown below, Audience Targeting (2) remains on the default set of All Visitors, for simplicity. This means the activity is untargeted. However, note Adobe recommends you always target your audiences for production activities. Click Next (3) to advance to the Goals & Settings step of activity creation.
-
In the Goals & Settings step, set Reporting Source to Adobe Target (1). Define the Goal Metric as Conversion, specifying the details based on your site’s conversion metrics (2). Click Save & Close (3) to save the activity.
5. Implement and render the feature in your application
After setting up the feature flag variables in Target, modify your application code to use them. For example, after getting the feature flag in the application, you can use it to enable features and render the experience for which the visitor qualified.
code language-js line-numbers |
---|
|
code language-javascript line-numbers |
---|
|
code language-csharp line-numbers |
---|
|
code language-python line-numbers |
---|
|
6. Implement additional tracking for events in your application
Optionally, you can send additional events for tracking conversions using the sendNotification() function.
code language-js line-numbers |
---|
|
code language-javascript line-numbers |
---|
|
code language-csharp line-numbers |
---|
|
code language-python line-numbers |
---|
|
7. Activate your A/B Test activity
-
Click Activate (1) to activate your A/B Test activity.
note note NOTE You must have the Approver or Publisher user role to perform this step.