2025.03.02 본_캠프 두번째 주차 마무리

민동·2025년 3월 2일
0

본캠프

목록 보기
11/74
post-thumbnail

이커머스 장바구니 취소 패턴 분석: 고객 이탈을 막기 위한 전략

1. 프로젝트 개요

이 프로젝트는 이커머스 이벤트 히스토리 데이터를 활용하여 장바구니 취소 패턴을 분석하는 것을 목표로 한다.
분석을 통해 장바구니에서 상품이 취소되는 주요 원인을 탐색하고, 고객의 구매 전환율을 높이기 위한 전략을 제시한다.

주요 분석 주제

  1. 장바구니 취소한 상품별 시간대 분석
  2. 일반 회원 vs VIP 회원의 장바구니 취소율 비교
  3. 장바구니 취소 후 다시 구매한 고객 분석

2. 데이터 전처리 & 이슈 해결

데이터 전처리 과정

  • ID 컬럼 크기 변환: 모든 id 컬럼을 BIGINT로 변경하여 크기 불일치 이슈 해결
  • 데이터 병합 문제: 용량 문제로 인해 5개월(2019년 10월~2020년 2월) 데이터를 개별 분석 후 통합

3. 분석 결과

1. 장바구니 취소한 상품별 시간대 분석

  • 장바구니 취소율이 가장 높은 시간대: 18~19시
  • 점심시간(11~12시)에도 취소율 증가 → 점심시간 한정 할인 가능성 고려

해결방안:

  • 18~19시 집중 할인 또는 쿠폰 제공
  • 장바구니 유지 시간을 고려한 알림 메시지 발송
  • 알리익스프레스처럼 시간제 쿠폰 도입

추가로 궁금한점

  • 왜 사람들이 특정 시간대에 취소율이 높은가?
  • 주어진 자료의 DATA로는 추론이 불가해서 아쉬웠음
  • 가설
  1. 경쟁사의 프로모션 영향
  2. 배송비 및 무료배송 조건 미충족
  3. 퇴근 하기전 장바구니에 급하게 담았다가 퇴근하면서 결정을 하지 못하고 취소할 수 있음

2. 일반 회원 vs VIP 회원의 장바구니 취소율 비교

VIP 선정 기준: 구매 총액 상위 10% 고객 찾기 (python)

df.columns
df['sum(price)'] = pd.to_numeric(df['sum(price)'], errors='coerce')
vip_threshold = df['sum(price)'].quantile(0.9)
print(f"VIP 기준 가격 (상위 10%): {vip_threshold:.2f}")
df['user_type'] = df['sum(price)'].apply(lambda x: 'VIP' if x >= vip_threshold else 'Regular')
vip_summary = df.groupby('user_type')['sum(price)'].sum().reset_index()
print(vip_summary)

VIP 기준 가격 (상위 10%): 95.20
user_type sum(price)
0 Regular 776568.73
1 VIP 434969.70

일반 고객 장바구니 포기율

select (select count(*)
	from 2019_dec
	where event_type = 'remove_from_cart'
		and price > 0
		and user_id in (select user_id
from 2019_dec
where event_type = 'purchase'
group by user_id
having sum(price) < 95))
/
	(select count(*)
	from 2019_dec
	where event_type = 'cart'
		and price > 0
		and user_id in (select user_id
from 2019_dec
where event_type = 'purchase'
group by user_id
having sum(price) < 95))
* 100 as regular;
VIP 고객 장바구니 포기율
select (select count(*)
	from 2019_dec
	where event_type = 'remove_from_cart'
		and price > 0
		and user_id in (select user_id
from 2019_dec
where event_type = 'purchase'
group by user_id
having sum(price) >= 95))
/
	(select count(*)
	from 2019_dec
	where event_type = 'cart'
		and price > 0
		and user_id in (select user_id
from 2019_dec
where event_type = 'purchase'
group by user_id
having sum(price) >= 95))
* 100
;

결과:

  • 일반 회원이 VIP 회원보다 장바구니 취소율이 높음
  • Regular 등급의 고객은 VIP 혜택이 집중되는 것을 느껴 상대적으로 이탈 가능성이 큼
  • VIP 회원일수록 구매 전환율이 높음

해결방안:

  • 새로운 회원 등급 시스템 도입 → VIP뿐만 아니라 일반 회원도 혜택을 받을 수 있도록 설계
  • 고객 구매 패턴에 따른 개인 맞춤형 혜택 제공
  • VIP 혜택 확대, 일반 회원도 일정 금액 이상 구매 시 혜택 제공

추가로 궁금한점

  • 우리 조가 VIP기준을 임의로 설정한게 근거가 있는 기준이였는지에 대한 의문점이 생김

3. 장바구니 취소 후 다시 구매한 고객 분석

1. 개요

장바구니에서 제거된 상품이 다시 구매되는 시간을 분석하여 고객의 구매 패턴을 파악하고, 가격대별로 차이가 있는지 확인하는 것이 목표다.

select MIN(t.time_difference_minutes) min_time,
	   ROUND(AVG(t.time_difference_minutes)) avg_time,
	   MAX(t.time_difference_minutes) max_time,
	   case when t.price < 5 then 'min_price'
			when t.price < 140 then 'low_price'
			when t.price < 210 then 'middle_price'
			when t.price < 280 then 'high_price'
			else 'max_price'
		end as price_category,
		count(*)
FROM 
(
SELECT
    r.user_id,
    r.product_id,
    r.removed_time,
    p.event_type AS next_action,
    p.event_time AS next_action_time,
    r.price as price,
    (DATEDIFF(SUBSTR(p.event_time, 1, 10), SUBSTR(r.removed_time, 1, 10)) * 1440) +
    (SUBSTR(p.event_time, 12, 2) - SUBSTR(r.removed_time, 12, 2)) * 60 +
    (SUBSTR(p.event_time, 15, 2) - SUBSTR(r.removed_time, 15, 2))  time_difference_minutes
FROM (
    SELECT user_id, product_id, event_time AS removed_time, price
    FROM 2019_nov
    WHERE event_type = 'remove_from_cart'
) r
JOIN (
    SELECT user_id, product_id, event_type, event_time
    FROM 2019_nov
    WHERE event_type = 'purchase'
) p
ON r.user_id = p.user_id
AND r.product_id = p.product_id
AND p.event_time > r.removed_time
ORDER BY r.user_id, r.removed_time, p.event_time
)t
GROUP BY price_category```

2. SQL 쿼리 설명

1. 장바구니 취소 후 다시 구매된 상품 추출

  • remove_from_cart(장바구니에서 제거)된 상품이 purchase(구매)된 경우만 필터링
  • JOIN을 사용해 같은 user_idproduct_id를 연결
FROM (
    SELECT user_id, product_id, event_time AS removed_time, price
    FROM 2019_nov
    WHERE event_type = 'remove_from_cart'
) r
JOIN (
    SELECT user_id, product_id, event_type, event_time
    FROM 2019_nov
    WHERE event_type = 'purchase'
) p
ON r.user_id = p.user_id
AND r.product_id = p.product_id
AND p.event_time > r.removed_time

2. 구매까지 걸린 시간 계산

  • DATEDIFF()SUBSTR()을 활용해 분 단위로 계산
(DATEDIFF(SUBSTR(p.event_time, 1, 10), SUBSTR(r.removed_time, 1, 10)) * 1440) +
(SUBSTR(p.event_time, 12, 2) - SUBSTR(r.removed_time, 12, 2)) * 60 +
(SUBSTR(p.event_time, 15, 2) - SUBSTR(r.removed_time, 15, 2))  AS time_difference_minutes

3. 가격대별 그룹화

상품 가격을 5개 구간으로 나누어 분석

CASE 
    WHEN t.price < 5 THEN 'min_price'
    WHEN t.price < 140 THEN 'low_price'
    WHEN t.price < 210 THEN 'middle_price'
    WHEN t.price < 280 THEN 'high_price'
    ELSE 'max_price'
END AS price_category

4. 가격대별 평균 재구매 시간 계산

  • 가격대별 최소, 평균, 최대 재구매 시간 및 빈도를 계산
SELECT MIN(t.time_difference_minutes) AS min_time,
       ROUND(AVG(t.time_difference_minutes)) AS avg_time,
       MAX(t.time_difference_minutes) AS max_time,
       price_category,
       COUNT(*)
FROM (서브쿼리) t
GROUP BY price_category;

3. 결과 요약

  1. 재구매까지 걸리는 평균 시간은 1~2일(2000~3000분)
  2. 저가 제품(min_price)은 빠르게 다시 구매됨
  3. 고가 제품(max_price)은 재구매까지 오랜 시간이 걸림
  4. 시간 한정 할인, 장바구니 리마인드 알림이 효과적일 가능성이 높음

4. 활용 방안

  • 저가 제품은 즉시 할인 제공
  • 고가 제품은 리뷰 강조 및 비교 분석 자료 제공
  • 장바구니 리마인드 알림 및 쿠폰 발송을 통해 재구매 유도
  • 장바구니에서 취소 후 재구매까지 걸리는 평균 시간: 2000~3000분 (약 1~2일)
  • 낮은 가격대의 상품일수록 장바구니 취소 후 재구매 확률이 높음
  • 미국의 경우 무료 배송 조건(50$ 이상)에 도달하지 못해 반복적인 취소 & 재구매 발생

4. 결론 & 인사이트

이커머스 비즈니스의 핵심은 고객 유지
이번 분석을 통해 고객 이탈을 줄이고 구매 전환율을 높이는 전략을 도출할 수 있었다.
이를 통해 비즈니스적 성장을 이루고, 고객 만족도를 높이는 방법을 설계할 수 있다

  • 시간대별 맞춤형 할인 & 쿠폰 제공
  • VIP뿐만 아니라 일반 회원에게도 혜택 확장
  • 장바구니 포기 고객에게 리마인드 메시지 & 배송비 혜택 제공

이커머스 비즈니스에서 가장 중요한 것은 ‘구매 경험’이며, 이를 최적화하는 것이 매출 상승의 핵심 요소이다.
앞으로도 더 효과적인 고객 맞춤형 마케팅 전략을 고민해봐야 할 것이다.

profile
아자아자

0개의 댓글