2017-08-17 25 views
1

說我要將瀏覽量數據傳輸到keen.io,並使用visitor_id屬性。除了那個屬性,還有一個is_customer布爾值。我該如何查詢有多少客戶點擊一個頁面,即使他們當時不是客戶?

pageview = { 
    "visitor_id" : "292n0s9f323" 
    "is_customer" : true, 
    "page" : "https://burningman.org/xyz" 
} 

我知道如何計算有多少上個月的獨立訪問者訪問/ XYZ頁,我知道如何計算有多少的那些在當時的客戶,他們擊中說網頁...但..

我如何計算本月有多少客戶訪問了/ xyz頁面,即使他們在訪問該頁面時不是客戶?

回答

2

您可以使用一個渠道來追溯計算,類似於您如何做廣告歸因。

var funnel = new Keen.Query("funnel", { 
    steps: [ 
    { // step one counts how many unique customers viewed any pages in the timeframe 
     event_collection: "pageview", 
     actor_property: "visitor_id", 
     timeframe: "this_30_days", 
     filters: [ 
     { 
      property_name: "is_customer", 
      operator: "eq", 
      property_value: true 
     } 
     ] 
    }, 
    { // step two counts how many of those specific visitors viewed XYZ page 
     event_collection: "pageview", 
     actor_property: "visitor_id", 
     timeframe: "this_30_days", 
     filters: [ 
     { 
      property_name: "is_customer", 
      operator: "eq", 
      property_value: true 
     } 
     ] 
    } 
    ] 
}); 

響應的樣子:

{ 
    "result": [ 
    3034, // count of unique customers who viewed any page 
    24 // count of those customers who at some point viewed XYZ page 
    ], 
    "steps": // additional metadata... 
} 
相關問題