初始化Node.js SDK
最後更新: 2024年7月20日
建立對象:
- undefined
說明
使用create
方法,以初始化Node.js SDK並將Target使用者端例項化,以呼叫Adobe Target進行實驗與個人化體驗。
方法
建立
TargetClient.create(options: Object): TargetClient
參數
options
具有以下結構:
名稱 | 類型 | 必要 | 預設值 | 說明 |
---|---|---|---|---|
使用者端 | 字串 | 是 | 無 | Adobe Target Client ID |
organizationId | 字串 | 是 | 無 | Experience Cloud Organization ID |
環境 | 字串 | 無 | 生產 | 目標環境名稱。 在Target UI中,Administration > Environments。 |
timeout | 數字 | 無 | 3000 | 逾時(毫秒) |
serverDomain | 字串 | 無 | *client*.tt.omtrdc.net | 覆寫預設主機名稱 |
secure | 布林值 | 無 | true | 取消設定以強制執行HTTP配置 |
logger | 物件 | 無 | NOOP記錄器 | 取代預設的NOOP記錄器 |
targetLocationHint | 字串 | 無 | 無 | Target位置提示 |
fetchApi | 函數 | 無 | global.fetch或window.fetch | SDK已將fetch用於http要求。 依預設,會使用節點擷取或擷取的瀏覽器實作。 但可使用fetchApi 提供替代實作 |
propertyToken | 字串 | 無 | 無 | 目標屬性權杖。 若在此處指定,則所有getOffers 呼叫都將使用此值。 針對裝置上決策,SDK只會下載包含在propertyToken 中設定的屬性權杖的合格活動的成品 |
決策方法 | 字串 | 無 | 伺服器端 | 決定要使用的決策方法(裝置上、伺服器端、混合式) |
pollingInterval | 數字 | 無 | 300000 (5分鐘) | 裝置上決策規則成品的輪詢間隔(毫秒) |
artifectlocation | 字串 | 無 | 無 | 裝置上決策規則成品的完整URL。 覆寫內部決定的位置。 |
artifactPayload | 物件 | 無 | 無 | 裝置上決策規則成品的JSON裝載。 若指定,會加以使用,而非向URL要求。 |
events | 物件<String,Function> | 否 | 無 | 具有事件名稱索引鍵和回呼函式值的選用物件 |
telemetryEnabled | 布林值 | 無 | true | 啟用後,Adobe將會收集SDK功能使用情況和效能遙測資料。 不會收集個人資料。 |
範例
Node.js
const CONFIG = {
client: "acmeclient",
organizationId: "1234567890@AdobeOrg",
events: {clientReady: targetClientReady }
};
const targetClient = TargetClient.create(CONFIG);
function targetClientReady() {
// make calls to Adobe Target
}
Target
- Adobe Target開發人員指南
- 快速入門
- 使用者端實作
- 概覽:為用戶端 Web 實作 Target
- Adobe Experience Platform Web SDK實作概觀
- at.js 實施
- at.js概覽
- at.js 如何運作
- 如何部署 at.js
- 裝置上決策
- at.js 函數
- at.js 函數概覽
- adobe.target.getOffer()
- adobe.target.getOffers() - at.js 2.x
- adobe.target.applyOffer()
- adobe.target.applyOffers() - at.js 2.x
- adobe.target.triggerView() - at.js 2.x
- adobe.target.trackEvent()
- mboxCreate() - at.js 1.x
- targetGlobalSettings()
- mboxDefine() 和 mboxUpdate() - at.js 1.x
- targetPageParams()
- targetPageParamsAll()
- registerExtension() - at.js 1.x
- sendNotifications() - at.js 2.1
- at.js 自訂事件
- 使用 Adobe Experience Cloud Debugger 除錯 at.js
- 使用雲端型例項搭配 Target
- at.js 常見問答
- at.js 版本詳細資料
- 從 at.js 1.x 升級為 at.js 2.x
- at.js Cookie
- 使用者代理和使用者端提示
- 瞭解全域 mbox
- 伺服器端實作
- 混合實施
- Recommendations實施
- 行動應用程式實作
- 電子郵件實作
- API指南
- 實作模式