此資訊可協助您了解回傳以及其運作方式。
此範例僅供參考之用。ADBMobileConfig.json
檔案應在 Adobe Mobile 使用者介面中設定,且不應手動修改。若您已啟用遠端訊息設定,手動編輯設定檔案可能會有危險。
ADBMobileConfig.json
定義"messages": [
{
"messageId": "79ae37c9-89b9-465e-af7f-d3351771f1dc",
"template": "callback",
"payload": {
"templateurl": "https://my.server.com/?user={user.name}&zip={user.zip}&c16={%sdkver%}&c27=cln,{a.PrevSessionLength}",
"templatebody": "c2RrdmVyPXslc2RrdmVyJX0mY2I9eyVjYWNoZWJ1c3QlfSZjbGllbnRJZD17bi5jbGllbnQuaWR9JnRzPXsldGltZXN0YW1wVSV9JnRzej17JXRpbWVzdGFtcFolfQ==",
"contenttype": "application/x-www-form-urlencoded",
"timeout": 4
},
"showOffline": true,
"showRule": "always",
"endDate": 2524730400,
"startDate": 0,
"audiences": [],
"triggers": [
{
"key": "pageName",
"matches": "eq",
"values": [
"MainMenu"
]
}
]
}
]
HashMap<String, Object> contextData = new HashMap<String, Object>();
contextData.put("user.name", "bob");
contextData.put("user.zip", "90210");
Analytics.trackState("MainMenu", contextData);
因為其狀態為 "MainMenu"
,所以此追蹤呼叫會觸發上述回傳訊息。URL 會以點擊中的值取代所有範本變數。假設使用者的上一個工作階段為 132 秒長,且該使用者使用 Android SDK 4.6.0 版,則最後的 URL 看起來會像這樣:
https://my.server.com/?user=bob&zip=90210&c16=4.6.0-AN&c27=cln,132