track_goal(
goal_name: str,
user_context: PageSenseUserContext,
goal_properties: dict[GoalProperty, str]
)
|
パラメーター
|
種類
|
必須
|
説明
|
|
goal_name
|
str
|
はい
|
設定済みの売上目標の名前です。
|
|
user_context
|
PageSenseUserContext
|
はい
|
目標の関連付けに使用する訪問者情報です。
|
|
goal_properties
|
dict[GoalProperty, str]
|
はい
|
売上目標のプロパティを含む辞書です。
|
|
種類
|
説明
|
|
None
|
このAPIは値を返しません。
|
|
目標プロパティ
|
値の種類
|
説明
|
|
GoalProperty.REVENUE
|
str
|
目標のコンバージョンに関連付けられる売上額です。
|
|
売上額
|
SDKに渡す値
|
|
$25.99
|
'2599'
|
|
€149.95
|
'14995'
|
from pagesense import GoalProperty
from pagesense import PageSenseUserContext
# Create the user attributesuser_attributes = {'Browser': 'Chrome','Device': 'Desktop'}# Create the PageSenseUserContext objectuser_context = PageSenseUserContext(user_id='USER_001',user_attributes=user_attributes)# Create the Revenue Goal propertygoal_properties = {
GoalProperty.REVENUE: '1999'
}# Track the Goalpagesense_client.track_goal(
goal_name,
user_context,
goal_properties
)