Here are a few solutions to this problem:
1: ? Keen funnel , ( ) A, B, C .. filter . ? , :
/keen.io//keen.io/products
.
2: .
, . -, select_unique, , (). count group_by user.id, , . 1 2, , . , 3 .
var client = new Keen({
projectId: "PROJECT_ID",
readKey: "READ_KEY"
});
var usersWhoPurchased = []
var usersWhoPurchasedQuery = new Keen.Query("select_unique", {
event_collection: "purchases",
target_property: "user.id",
timeframe: "this_7_days"
});
client.run(usersWhoPurchasedQuery, function(err, response){
usersWhoPurchased = response['result']
});
var activityCountsByUserQuery = new Keen.Query("count", {
event_collection: "pageviews",
group_by: "user.id",
timeframe: "this_7_days",
filters: [
{
property_name: "url",
operator: "eq",
property_value: https:
},
{
property_name: "user.id",
operator: "in",
property_value: usersWhoPurchased
}
]
});
client.run(activityCountsByUserQuery, function(err, response){
console.log(response)
var countsByUser = response['result']
});
, ( ID). .
3: .
, , . , . , :
{
"collection_name":"pageviews",
"properties":{
"user":{
"id":"4242"
},
"url":"https://keen.io/",
"product_views_this_session":4
}
}
, .
4: , S3 Streaming + AWS Lambda + RDS DynamoDB
, Keen Amazon S3. .
:
:
{
"collection_name":"user_product_view_enriched",
"properties":{
"user":{
"id":"4242"
},
"url":"https://store.io/productA45",
"view_history":{
"product":"A45",
"lifetime_views":5,
"counting_since":"<timestamp>"
}
}
}
Keen , 3:
user_product_view_enriched "A45" lifetime_views > X- ,
, , . , , , 3 , . S3, , , , bigga.
5: S3 EMR / Athena
S3 , . , , , .