初始化Python SDK
說明
使用create
方法,以初始化Python SDK並將Target Client例項化,以呼叫Adobe Target進行實驗與個人化體驗。
方法
建立
TargetClient.create(options)
參數
options
具有以下結構:
名稱
類型
必要
預設值
說明
使用者端
str
是
無
Adobe Target client ID
organization_id
str
是
無
Experience Cloud Organization ID
timeout
int
否
3000
逾時(毫秒)
server_domain
str
否
client.tt.omtrdc.net
secure
布林值
否
true
取消設定以強制執行HTTP配置
logger
物件
否
資訊記錄器
target_location_hint
str
否
無
Target位置提示
property_token
str
否
無
Target屬性權杖。 若在此處指定,所有get_offers呼叫都會使用此值。
environment_id
int
否
生產
Target環境識別碼
環境
str
否
生產
Target環境名稱
cdn_environment
str
否
生產
CDN環境名稱
telemetry_enabled
布林值
否
True
如果設為False,將不會傳送遙測資料給Adobe
version
str
否
無
此SDK的版本號碼
範例
Python
from target_python_sdk import TargetClient
def client_ready_callback(ready_event):
# make calls to Adobe Target
client_options = {
"client": "acmeclient",
"organization_id": "1234567890@AdobeOrg",
"events": {
"client_ready": client_ready_callback
}
}
target_client = TargetClient.create(client_options)
recommendation-more-help
6906415f-169c-422b-89d3-7118e147c4e3