会員ログの活用法 第26回
直近90日の動きを点数にすると、会員の4割は0点。上位1割強の会員に動きが集中している。
営業やMRの担当者に会員の情報を渡すとき、「最近よく見ている会員」を挙げてほしいと言われることがあります。アクセスの多い会員を目で探すと、担当者ごとに基準がばらばらになります。
会員の動きは、サイトに来る、メールのリンクを押す、申し込む、といくつかの記録に分かれています。どれか一つだけで選ぶと、メールにはよく反応するけれどサイトにはあまり来ない会員、といった人を取りこぼします。
会員IDでこれらの記録をつなぐと、会員ごとに直近の動きを点数にまとめられます。点の付け方は簡単でかまいません。同じ基準で並べられることが大事です。
直近90日の点数,会員(人) 0点,377 1〜2点,45 3〜5点,135 6〜10点,147 11〜20点,130 21点以上,114
このグラフの数え方
架空のサンプルデータで集計した例です。
ここに挙げた使い方は一例です。サンプルの数字は架空のもので、実際の結果や施策の効果を約束するものではありません。
ここから先は、システム担当者に渡してください。集計SQLで出た結果を、AIプロンプトと一緒にAIへ貼ると、上のようなグラフと読み取りが返ってきます。
with v as (
select member_id, count(distinct accessed_at::date) as visit_days
from access_log
where member_id is not null
and accessed_at >= date '2026-09-30' - 89 -- 基準日を含む直近90日。基準日は実際には current_date にする
and accessed_at < date '2026-09-30' + 1
group by member_id
),
c as (
select member_id, count(*) as clicks
from mail_event
where event_type = 'click'
and event_at >= date '2026-09-30' - 89
and event_at < date '2026-09-30' + 1
group by member_id
),
f as (
select member_id, count(*) as applications
from form_submission
where submitted_at >= date '2026-09-30' - 89
and submitted_at < date '2026-09-30' + 1
group by member_id
)
select case
when score = 0 then '0点'
when score <= 2 then '1〜2点'
when score <= 5 then '3〜5点'
when score <= 10 then '6〜10点'
when score <= 20 then '11〜20点'
else '21点以上'
end as score_band,
count(*) as members
from (
select m.member_id,
coalesce(v.visit_days, 0) * 1
+ coalesce(c.clicks, 0) * 2
+ coalesce(f.applications, 0) * 5 as score
from member m
left join v on v.member_id = m.member_id
left join c on c.member_id = m.member_id
left join f on f.member_id = m.member_id
where m.withdrawn_at is null
and m.registered_at < date '2026-09-30' + 1 -- 基準日までに登録した会員
) t
group by 1
order by min(score);次の表は、会員サイトの会員を、直近90日の動きから付けた点数で分けた集計です。
点数は、サイトを利用した(ログインしてページを見た)日1日につき1点、メールのリンクを押した1回につき2点、申し込み1件につき5点です。
score_band=点数の帯、members=会員数(退会者を除く)です。
個人を特定できる列は含めていません。
1. score_band ごとの members を棒グラフにして、画像で描いてください。各区分に、全体に占める割合を添えてください。
2. 次の点を読み取って、3行程度で教えてください。
・0点の会員は何割か
・点数の高い会員はどれくらいいるか
・この点数を、担当者への情報提供や案内の出し分けにどう使えるか
(ここに集計結果を貼る)-- 社内用:会員IDの一覧が出ます。社外のサービスやAIには貼らないでください
with v as (
select member_id, count(distinct accessed_at::date) as visit_days
from access_log
where member_id is not null
and accessed_at >= date '2026-09-30' - 89 -- 基準日を含む直近90日。基準日は実際には current_date にする
and accessed_at < date '2026-09-30' + 1
group by member_id
),
c as (
select member_id, count(*) as clicks
from mail_event
where event_type = 'click'
and event_at >= date '2026-09-30' - 89
and event_at < date '2026-09-30' + 1
group by member_id
),
f as (
select member_id, count(*) as applications
from form_submission
where submitted_at >= date '2026-09-30' - 89
and submitted_at < date '2026-09-30' + 1
group by member_id
)
select m.member_id, m.occupation, m.specialty,
coalesce(v.visit_days, 0) as visit_days,
coalesce(c.clicks, 0) as clicks,
coalesce(f.applications, 0) as applications,
coalesce(v.visit_days, 0) * 1
+ coalesce(c.clicks, 0) * 2
+ coalesce(f.applications, 0) * 5 as score
from member m
left join v on v.member_id = m.member_id
left join c on c.member_id = m.member_id
left join f on f.member_id = m.member_id
where m.withdrawn_at is null
and m.registered_at < date '2026-09-30' + 1 -- 基準日までに登録した会員
order by score desc
limit 100;SQLとプロンプトは、準備編の汎用テーブルを前提にした例です。実際のテーブル名・列名に合わせて書き換えてください。動作や結果を保証するものではありません。
使う表: member(会員)/access_log(アクセスログ)/mail_event(メール送信と反応)/form_submission(フォーム送信) (表の形は準備編)
アクセスログ、メールの記録、フォームの送信記録が、会員IDでつながっていないと、この点数は作れません。
それぞれの仕組みで別々に会員を数えると、同じ人の動きを一つにまとめられないからです。
writeWiredでは、会員IDの付いたアクセスログとメール・フォームの記録が最初から同じ場所に揃っています。会員サイトCMSとしてのwriteWired