LoginSignup
1
0

More than 5 years have passed since last update.

Keen IOでメディアのページビュー分析

Posted at

メディアの閲覧データで分析したい事

  • どの閲覧者が最もページビューが多いか
  • どのトピックが最もページビューが多いか
  • どのランディングページが最も多くクリックされるか
  • 最も多く記事が読まれるのはどの曜日か
  • スポンサー広告のクリック数が多いのはどの種類の記事か

サンプルでのトラッキング

今回のサンプルサイト
image.png

すべてのページビューで一連のプロパティを収集する

  • トピック
  • タイトル
  • ブラウザ情報
  • 外部参照(どのようにしてアクセスしてきたか)
  • 著者

外部参照からのランディングページビュー

{
   "page":{
    "url":"/topics/scoops-and-scandals",
    "type":"Landing",
    "topic":{
      "id":10,
      "title":"Scoops and Scandals"
    }
  },
  "user_agent":{
    "browser":{
      "name":"Chrome",
      "version":"28.0.1500.95",
      "major":28
    },
    "engine":{
      "name":"WebKit",
      "version":"537.36"
    },
    "os":{
      "name":"Mac OS X",
      "version":"10.7.4"
    }
  },
  "referrer":{
    "type":"external",  "source":"http://www.referrer.com/some/ad?param1=foo\u0026param2=bar/#someplace",
    "protocol":"http",
    "domain":"www.referrer.com"
  },
  "session":{
    "session_id":"session-cookie",
    "unique_id":"unique-cookie"
  },
  "at":{
    "timestamp":"2015-06-24T07:44:27.737-07:00",
    "day_of_week":"Wednesday",
    "hour_of_day":7
  }
}

内部参照元からの記事ページビュー

{
  "page":{
    "url":"/articles/learning-to-fly",
    "type":"Article",
    "author":"Danaerys Targaryen",
    "keywords":["espionage","investment"]
  },
  "user_agent":{
    "browser":{
      "name":"Chrome",
      "version":"28.0.1500.95",
      "major":28
    },
    "engine":{
      "name":"WebKit",
      "version":"537.36"
    },
    "os":{
      "name":"Mac OS X",
      "version":"10.7.4"
    }
  },
  "referrer":{
    "type":"internal",
    "source":"/topics/current-affairs",
    "keyword":"investment"
  },
  "session":{
    "session_id":"session-cookie",
    "unique_id":"unique-cookie"
  },
  "at":{
    "timestamp":"2015-06-24T07:45:27.900-07:00",
    "day_of_week":"Wednesday",
    "hour_of_day":7
  }
}

RDBの行ではなくJSONプロパティの集まりなので必要な分だけいくらでも増減可能

分析

どの著者が最も多くのページビューを生み出しているか

Group Byを利用

var client = new Keen({
  projectId: "PROJECT_ID",
  readKey: "READ_KEY"

});
Keen.ready(function(){
  var query = new Keen.Query("count", {
    event_collection: "page_views",
    timeframe: "this_14_days",
    filters: [
      {
        property_name:"page.type",
        operator:"eq",
        property_value:"Article"
      }
    ],
    group_by: "page.author",
    timezone: "UTC"
  });
  client.draw(query, document.getElementById("my_chart"), {
    // Custom configuration here
  });
});

image.png

最も多いページビューはどのトピックか

トピック別にまとめられたランディングページをフィルタリング

Keen.ready(function(){
  var query = new Keen.Query("count", {
    event_collection: "page_views",
    timeframe: "this_14_days",
    filters: [{"operator":"eq","property_name":"page.type","property_value":"Landing"}],
    group_by: "page.topic.title",
    timezone: "UTC"
  });
  client.draw(query, document.getElementById("my_chart"), {
    // Custom configuration here
  });
});

image.png

各トピックが生成する外部トラフィックの量

Keen.ready(function(){
  var query = new Keen.Query("count", {
    event_collection: "page_views",
    timeframe: "this_14_days",
    filters: [{"operator":"eq","property_name":"page.type","property_value":"Landing"},{"operator":"eq","property_name":"referrer.type","property_value":"external"}],
    group_by: "page.topic.title",
    timezone: "UTC"
  });
  client.draw(query, document.getElementById("my_chart"), {
    // Custom configuration here
  });

image.png

どの曜日が最もページビューが多いか

Keen.ready(function(){
  var query = new Keen.Query("count", {
    event_collection: "page_views",
    timeframe: "this_14_days",
    group_by: "at.day_of_week",
    timezone: "UTC"
  });
  client.draw(query, document.getElementById("my_chart"), {
    // Custom configuration here
  });

image.png

最も関心を引くのはどのキーワードか

記事にタグ付けしてユーザーがコンテンツに関わる機会を増やす

Keen.ready(function(){
  var query = new Keen.Query("count", {
    event_collection: "page_views",
    timeframe: "this_14_days",
    filters: [{"operator":"eq","property_name":"referrer.type","property_value":"internal"}],
    group_by: "referrer.keyword",
    timezone: "UTC"
  });
  client.draw(query, document.getElementById("my_chart"), {
    // Custom configuration here
  });
})

image.png

誰が「adventure」キーワードで一番ページビューが多いか

Keen.ready(function(){
  var query = new Keen.Query("count", {
    event_collection: "page_views",
    timeframe: "this_14_days",
    filters: [{"operator":"in","property_name":"referrer.keyword","property_value":["adventure"]},{"operator":"eq","property_name":"page.type","property_value":"Article"}],
    group_by: "page.author",
    timezone: "UTC"
  });
  client.draw(query, document.getElementById("my_chart"), {
    // Custom configuration here
  });
});

image.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0