即使他们当时不是客户,我如何查询有多少客户点击页面?

时间:2017-08-17 00:10:08

标签: analytics keen-io

假设我正在使用visitor_id属性将网页浏览数据传输到keen.io。除了该属性之外,还有一个is_customer布尔值。

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

我知道如何计算上个月有多少独特的访问者访问/ xyz页面,我知道如何计算他们在访问该页面时有多少客户......但是......

我如何计算本月有多少客户访问/ xyz页面,即使他们在访问该页面时不是客户?

1 个答案:

答案 0 :(得分: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...
}