Show Menu
主題×

將活動資訊傳送到 Adobe Analytics

This section describes how to send Target mobile app activity information to Adobe Analytics for post hoc segmentation.
必要條件
  • This integration requires that Analytics and Target are implemented using the mobile SDK.
  • Ensure that your report suite is enabled to receive activity information from Target.
    This is usually done by adding the Target client code to the Analytics report suite. 如果您正在使用 SiteCatalyst-Test&Target 整合來處理網頁活動,該功能可能已啟用。如果您對這個步驟有任何問題,請連絡 Adobe 客戶服務。
  1. 取得活動資訊。
    If you include a string like the following in your experience content, Target returns the activity information that you can send to Analytics:
    ${campaign.id}:${campaign.recipe.id}:${campaign.recipe.trafficType}
    
    
    請將體驗 json 程式碼中的文字取代為類似以下範例的內容:
    { 
      "tntVal": ${campaign.id}:${campaign.recipe.id}:${campaign.recipe.trafficType}", 
      "title":"Welcome Message", 
      "message":"Get Free Shipping Today!" 
    }
    
    
    In this example, a node with the variable tntVal is added to obtain the activity information. 請為其他體驗新增類似的程式碼,並附上適當標題和訊息。
    This string delivers a number (such as 115110:0:0) in the response from Target. 這表示活動ID、體驗ID和流量類型。 The following is a sample response from Target:
    { 
      "tntVal": 115110:0:0", 
      "title":"Welcome Message", 
      "message":"Get Free Shipping Today!" 
    }
    
    
  2. 剖析 JSON 物件。
    Parse the response that came back from Target in the callback. You can use NSJSONSerialization to parse this response and store it in a dictionary or an array.
    有關詳細資訊, 請參閱NSJSONSerialization文檔
  3. 將資料傳送到 Analytics.
    將剖析後的活動資訊 (如前述回應中的 tntVal ) 新增到 呼叫中的內容資料物件。AnalyticsThis Analytics call containing the context data can be fired immediately or it can wait until the next Analytics call is fired.
    例如,它可以在 targetLoadRequest 呼叫的回呼中觸發:
    [ADBMobile trackAction:@"Welcome Screen"  
          data:@{@"&&tnt" : tntVal from response}];
    
    
    &&tnt 是行動 SDK 中保留的事件索引鍵。The post-classification of the tntVal variable in Analytics works in the same way in the mobile SDK as it does on the web (JavaScript). After the information is processed in Analytics, you should see activity and experience names in the Analytics interface.