使用屬性執行功能測試
建立對象:
- undefined
步驟摘要
- 為您的組織啟用on-device decisioning
- 建立A/B Test活動
- 定義您的A和B
- 新增對象
- 設定流量分配
- 將流量分佈設為變數
- 設定報告
- 新增追蹤KPI的量度
- 實作程式碼以使用屬性執行功能測試
- 實作程式碼以追蹤轉換事件
- 使用屬性啟用功能測試
1.為您的組織啟用on-device decisioning
啟用裝置上決策可確保在幾乎零延遲的情況下執行A/B活動。 若要啟用此功能,請瀏覽至Adobe Target中的 Administration > Implementation > Account details,並啟用 On-Device Decisioning 切換按鈕。
啟用 On-Device Decisioning 切換後,Adobe Target會開始為您的使用者端產生 規則成品。
2.建立A/B Test活動
-
在Adobe Target中,導覽至 Activities 頁面,然後選取 Create Activity > A/B test。
-
在 Create A/B Test Activity 強制回應視窗中,保留預設的 Web 選項為已選取(1)、選取 Form 作為您的體驗撰寫器(2)、選取具有 No Property Restrictions (3)的 Default Workspace,然後按一下 Next (4)。
3.定義您的A和B
-
在活動建立的 Experiences 步驟中,提供活動的名稱(1)並新增第二個體驗,即體驗B,方法是按一下 Add Experience (2)按鈕。 輸入應用程式中要使用屬性執行特徵測試的位置(3)名稱。 在下列範例中,
product-results-page
是為體驗A定義的位置。(也是為體驗B定義的位置。)Experience A 將包含代表您商業邏輯執行下列動作的JSON:
- 透過
test_sorting
功能標幟啟動排序演演算法功能 - 執行
sorting_algorithm _**_attribute
中定義的建議排序演演算法 - 依
pagination_limit
中定義的分頁策略所定義,每頁傳回50項產品
- 透過
-
在體驗A中,按一下以選取 Create JSON Offer,將內容從 Default Content 變更為JSON,如下所示(1)。
-
定義具有
test_sorting
、sorting_algorithm
和pagination_limit
旗標和屬性的JSON,這些旗標和屬性將用於起始分頁限製為50個產品的建議排序演演算法。NOTE
當Adobe Target儲存使用者以檢視體驗A時,將會傳回範例中具有已定義屬性的JSON。 在您的程式碼中,您需要檢查功能標幟test_sorting
的值,以檢視是否應開啟排序功能。 若是如此,您將會使用sorting_algorithm
屬性的建議值,在產品清單檢視中顯示建議產品。 為您的應用程式顯示的產品限制將為50,因為這是pagination_limit
屬性的值。Experience B 將定義代表您的商業邏輯執行下列動作的JSON:
- 透過test_sorting功能旗標啟動排序演演算法功能
- 執行
sorting_algorithm _**_attribute
中定義的best_sellers
排序演演算法 - 依
pagination_limit
中定義的分頁策略所定義,每頁傳回50項產品
NOTE
當Adobe Target儲存使用者以檢視體驗B時,將會傳回範例中具有已定義屬性的JSON。 在您的程式碼中,您需要檢查功能標幟test_sorting
的值,以檢視是否應開啟排序功能。 若是如此,您將會使用sorting_algorithm
屬性的best_sellers
值,在產品清單檢視中顯示最暢銷的產品。 為您的應用程式顯示的產品限制將為50,因為這是pagination_limit
屬性的值。
4.新增對象
在 Targeting 步驟中,保留 All Visitors 對象。 這可讓您瞭解排序功能的影響,以及哪個演演算法和專案數量對結果影響最大。
5.設定流量分配
定義訪客百分比,以用來測試排序演演算法和分頁策略。 換言之,您要將這個測試轉出到您的使用者中哪個百分比? 在此範例中,若要將此測試部署給所有登入的使用者,請將流量分配維持在100%。
6.將流量分佈設為變數
定義會看見建議與最暢銷商品排序演演算法的訪客百分比,限製為每頁50項產品。 在此範例中,流量分配在體驗A和B之間維持50/50的分割比例。
7.設定報告
在 Goals & Settings 步驟中,選擇 Adobe Target 作為 Reporting Source,以便在Adobe Target UI中檢視您的A/B測試結果,或選擇 Adobe Analytics 以便在Adobe Analytics UI中檢視這些結果。
8.新增追蹤KPI的量度
選擇 Goal Metric 以使用屬性測量功能測試。 在此範例中,成功取決於使用者是否購買產品,取決於他們看到的排序演演算法和分頁策略。
9.使用屬性實施功能測試至您的應用程式
const TargetClient = require("@adobe/target-nodejs-sdk");
const options = {
client: "testClient",
organizationId: "ABCDEF012345677890ABCDEF0@AdobeOrg",
decisioningMethod: "on-device",
events: {
clientReady: targetClientReady
}
};
const targetClient = TargetClient.create(options);
function targetClientReady() {
return targetClient.getAttributes(["product-results-page"]).then(function(attributes) {
const test_sorting = attributes.getValue("product-results-page", "test-sorting");
const sorting_algorithm = attributes.getValue("product-results-page", "sorting_algorithm");
const pagination_limit = attributes.getValue("product-results-page", "pagination_limit");
});
}
import com.adobe.target.edge.client.ClientConfig;
import com.adobe.target.edge.client.TargetClient;
import com.adobe.target.delivery.v1.model.ChannelType;
import com.adobe.target.delivery.v1.model.Context;
import com.adobe.target.delivery.v1.model.ExecuteRequest;
import com.adobe.target.delivery.v1.model.MboxRequest;
import com.adobe.target.edge.client.entities.TargetDeliveryRequest;
import com.adobe.target.edge.client.model.TargetDeliveryResponse;
ClientConfig config = ClientConfig.builder()
.client("testClient")
.organizationId("ABCDEF012345677890ABCDEF0@AdobeOrg")
.build();
TargetClient targetClient = TargetClient.create(config);
MboxRequest mbox = new MboxRequest().name("product-results-page").index(0);
TargetDeliveryRequest request = TargetDeliveryRequest.builder()
.context(new Context().channel(ChannelType.WEB))
.execute(new ExecuteRequest().mboxes(Arrays.asList(mbox)))
.build();
Attributes attributes = targetClient.getAttributes(request, "product-results-page");
String testSorting = attributes.getString("product-results-page", "test-sorting");
String sortingAlgorithm = attributes.getString("product-results-page", "sorting_algorithm");
String paginationLimit = attributes.getString("product-results-page", "pagination_limit");
10.實作程式碼以追蹤轉換事件
//... Code removed for brevity
//When a conversion happens
TargetClient.sendNotifications({
targetCookie,
"request" : {
"notifications" : [
{
type: "click",
timestamp : Date.now(),
id: "conversion",
mbox : {
name : "product-results-page"
}
}
]
}
})
ClientConfig config = ClientConfig.builder()
.client("acmeclient")
.organizationId("1234567890@AdobeOrg")
.build();
TargetClient targetClient = TargetClient.create(config);
Context context = new Context().channel(ChannelType.WEB);
ExecuteRequest executeRequest = new ExecuteRequest();
NotificationDeliveryService notificationDeliveryService = new NotificationDeliveryService();
Notification notification = new Notification();
notification.setId("conversion");
notification.setImpressionId(UUID.randomUUID().toString());
notification.setType(MetricType.CLICK);
notification.setTimestamp(System.currentTimeMillis());
notification.setTokens(
Collections.singletonList(
"IbG2Jz2xmHaqX7Ml/YRxRGqipfsIHvVzTQxHolz2IpSCnQ9Y9OaLL2gsdrWQTvE54PwSz67rmXWmSnkXpSSS2Q=="));
TargetDeliveryRequest targetDeliveryRequest =
TargetDeliveryRequest.builder()
.context(context)
.execute(executeRequest)
.notifications(Collections.singletonList(notification))
.build();
TargetDeliveryResponse offers = targetClient.getOffers(request);
notificationDeliveryService.sendNotification(request);
Attributes attributes = targetClient.getAttributes(request, "product-results-page");
String testSorting = attributes.getString("product-results-page", "test-sorting");
String sortingAlgorithm = attributes.getString("product-results-page", "sorting_algorithm");
String paginationLimit = attributes.getString("product-results-page", "pagination_limit");
11.使用屬性啟用功能測試