CRM 이벤트 스키마
본 문서는 flarelane이 발행하는 crm 이벤트의 페이로드 정의와, 이벤트 내보내기 시 적재되는 parquet(glue 테이블) 스키마를 정의합니다 이벤트 페이로드(json)는 camelcase, parquet 컬럼은 snake case 를 사용합니다 예 페이로드 campaignid ↔ parquet campaign id crm 이벤트 1\ 공통 envelope 모든 crm 이벤트가 공유하는 최상위 필드입니다 필드 타입 필수 설명 id string required 이벤트 고유 식별자 (ulid) type string required 이벤트 타입 예 push sent (네임스페이스 prefix 없음) time string required 이벤트 발생 시각 (rfc 3339, utc) projectid string required 플레어레인 프로젝트 식별자 userid string optional 플레어레인 사용자 식별자 (미식별 사용자 시 null) deviceid string optional 플레어레인 기기 식별자 push struct optional push 페이로드 (§2) sms struct optional sms 페이로드 (§3) kakaoalimtalk struct optional kakao 알림톡 페이로드 (§4) kakaofriendtalk struct optional kakao 친구톡 / 브랜드 메시지 페이로드 (§5) email struct optional email 페이로드 (§6) iam struct optional inappmessage 페이로드 (§7) 한 이벤트는 정확히 하나의 채널 페이로드만 채워지며, 나머지 채널 struct는 null 입니다 2\ push 이벤트 2 1 이벤트 타입 type 설명 push create 푸시 발송 요청 생성 (pns 호출 전) push sent 푸시 발송 성공 (pns 정상 응답) push failed 푸시 발송 실패 push clicked 사용자가 푸시를 클릭함 2 2 push 페이로드 필드 필드 타입 필수 설명 campaignid string required 캠페인 식별자 campaignname string optional 캠페인 명칭 templateid string optional 템플릿 식별자 templatename string optional 템플릿 명칭 title string optional 푸시 제목 (interpolation 이전 원본) body string required 푸시 본문 (interpolation 이전 원본) triggertype enum optional 발송 트리거 api / console / test / journey platform enum required 단말 플랫폼 android / ios / webdesktop / webmobile journeyid string optional (triggertype=journey) 저니 식별자 journeyname string optional 저니 명칭 journeystepid string optional 저니 스텝 식별자 journeyenrollmentid string optional 사용자별 저니 실행 식별자 recurringmessageid string optional 반복 발송 메시지 식별자 provider string optional 푸시 공급자 fcm / apns / webpush providermessageid string optional 공급자 측 메시지 id providererror string optional 공급자 측 오류 메시지 error string optional 오류 메시지 3\ sms 이벤트 3 1 이벤트 타입 type 설명 sms create sms 발송 요청 생성 (provider 호출 전) sms sent provider에 정상 접수됨 sms failed provider 접수 실패 sms delivered 수신 단말에 전달 완료 (provider 콜백 기반) sms undelivered 수신 단말 전달 실패 (provider 콜백 기반) 3 2 sms 페이로드 필드 필드 타입 필수 설명 campaignid string required 캠페인 식별자 campaignname string optional 캠페인 명칭 messagetype enum required 메시지 유형 sms / lms / mms title string optional lms/mms 제목 body string required 본문 (interpolation 이전 원본) fromphonenumber string required 발신 번호 tophonenumber string optional 수신 번호 isadvertisement boolean required 광고 여부 triggertype enum optional api / console / test / journey platform enum optional 단말/발송 플랫폼 android / ios / webdesktop / webmobile journeyid string optional 저니 식별자 journeyname string optional 저니 명칭 journeystepid string optional 저니 스텝 식별자 journeyenrollmentid string optional 사용자별 저니 실행 식별자 recurringmessageid string optional 반복 발송 메시지 식별자 error string optional 오류 메시지 4\ kakao 알림톡 (alimtalk) 이벤트 4 1 이벤트 타입 type 설명 kakaoalimtalk created 알림톡 발송 요청 생성 (provider 호출 전) kakaoalimtalk sent provider에 정상 접수됨 kakaoalimtalk failed provider 접수 실패 kakaoalimtalk delivered 수신 단말에 전달 완료 (provider 콜백 기반) kakaoalimtalk undelivered 수신 단말 전달 실패 (provider 콜백 기반) 4 2 kakaoalimtalk 페이로드 필드 필드 타입 필수 설명 campaignid string required 캠페인 식별자 campaignname string optional 캠페인 명칭 templateid string required 플레어레인 내부 템플릿 식별자 templatecode string required 카카오 검수 템플릿 코드 templatename string optional 템플릿 명칭 title string optional 강조표기형 제목 body string required 본문 (interpolation 이전 원본) tophonenumber string required 수신 번호 messagetype string required 메시지 유형 triggertype enum optional api / console / test / journey platform enum optional 단말/발송 플랫폼 android / ios / webdesktop / webmobile journeyid string optional 저니 식별자 journeyname string optional 저니 명칭 journeystepid string optional 저니 스텝 식별자 journeyenrollmentid string optional 사용자별 저니 실행 식별자 recurringmessageid string optional 반복 발송 메시지 식별자 error string optional 오류 메시지 5\ kakao 친구톡 / 브랜드 메시지 (friendtalk) 이벤트 5 1 이벤트 타입 type 설명 kakaofriendtalk created 브랜드메세지 발송 요청 생성 (provider 호출 전) kakaofriendtalk sent provider에 정상 접수됨 kakaofriendtalk failed provider 접수 실패 kakaofriendtalk delivered 수신 단말에 전달 완료 (provider 콜백 기반) kakaofriendtalk undelivered 수신 단말 전달 실패 (provider 콜백 기반) 5 2 kakaofriendtalk 페이로드 필드 필드 타입 필수 설명 campaignid string required 캠페인 식별자 campaignname string optional 캠페인 명칭 senderkey string optional 카카오 발신 프로필(채널) 키 body string required 본문 (interpolation 이전 원본) header string optional 메시지 헤더 tophonenumber string required 수신 번호 messagetype string required 메시지 유형 isadvertisement boolean optional 광고 여부 triggertype enum optional api / console / test / journey journeyid string optional 저니 식별자 journeyname string optional 저니 명칭 journeystepid string optional 저니 스텝 식별자 journeyenrollmentid string optional 사용자별 저니 실행 식별자 recurringmessageid string optional 반복 발송 메시지 식별자 platform enum optional 단말/발송 플랫폼 android / ios / webdesktop / webmobile error string optional 오류 메시지 ssot 정합화 메모 senderkey(sender key)는 glue 테이블(ssot)에 새로 존재하여 추가했습니다 6\ email 이벤트 6 1 이벤트 타입 type 설명 email created 이메일 발송 요청 생성 email sent provider 접수 완료 email failed provider 접수 실패 email delivered 수신 메일서버에 전달 완료 email opened 수신자가 이메일을 열람함 email clicked 수신자가 이메일 내 링크를 클릭함 email complaint 스팸 신고 발생 6 2 email 페이로드 필드 필드 타입 필수 설명 campaignid string required 캠페인 식별자 campaignname string optional 캠페인 명칭 templateid string required 템플릿 식별자 templatename string optional 템플릿 명칭 title string optional 메일 제목 fromemail string required 발신 이메일 주소 toemail string optional 수신 이메일 주소 triggertype enum optional api / console / test / journey platform enum optional 단말/발송 플랫폼 android / ios / webdesktop / webmobile journeyid string optional 저니 식별자 journeyname string optional 저니 명칭 journeystepid string optional 저니 스텝 식별자 journeyenrollmentid string optional 사용자별 저니 실행 식별자 recurringmessageid string optional 반복 발송 메시지 식별자 error string optional 오류 메시지 참고 메일 본문(body)은 크기가 커 포함되지 않습니다 7\ inappmessage 이벤트 7 1 이벤트 타입 type 설명 iam created 인앱 메시지 노출 요청 생성 (서버 측) iam displayed 사용자 단말에서 인앱이 노출됨 (sdk 이벤트) iam clicked 사용자가 인앱 cta 버튼을 클릭함 (sdk 이벤트) iam closed 사용자가 인앱을 닫음 (sdk 이벤트) 7 2 iam 페이로드 필드 필드 타입 필수 설명 campaignid string required 캠페인 식별자 campaignname string optional 캠페인 명칭 group string required 인앱 그룹/분류 hive 예약어이므로 athena 쿼리 시 backtick(`group`) 필요 triggertype enum optional console / journey (인앱은 두 가지만 사용) journeyid string optional 자동화 인앱일 때 저니 식별자 journeyname string optional 저니 명칭 journeystepid string optional 저니 스텝 식별자 journeyenrollmentid string optional 사용자별 저니 실행 식별자 platform enum optional 단말 플랫폼 android / ios / webdesktop / webmobile sdk 이벤트 시에만 채워짐 (iam created 에서는 null) clickableid string optional cta 버튼 식별자 iam clicked 전용 dontshowminutes integer optional "다시 보지 않기" 분 단위 값 iam closed 전용 0 또는 null 이면 단순 닫기, 양수면 n분간 미노출 8\ parquet 스키마 (aws glue catalog 호환) s3 적재 및 athena 쿼리를 위한 glue 테이블 정의입니다 (template yml 기준) 채널별 페이로드는 별도 struct 컬럼으로 매핑되며, 한 이벤트에 해당하지 않는 채널 struct는 null 입니다 projectid 와 date 는 파티션 키이며, athena partition projection 으로 노출됩니다 { "columns" \[ { "name" "id", "type" "string" }, { "name" "type", "type" "string" }, { "name" "time", "type" "string" }, { "name" "deviceid", "type" "string" }, { "name" "userid", "type" "string" }, { "name" "push", "type" "struct\<campaign id\ string,campaign name\ string,template id\ string,template name\ string,title\ string,body\ string,trigger type\ string,platform\ string,journey id\ string,journey name\ string,journey step id\ string,journey enrollment id\ string,recurring message id\ string,provider\ string,provider message id\ string,provider error\ string,error\ string>" }, { "name" "sms", "type" "struct\<campaign id\ string,campaign name\ string,message type\ string,title\ string,body\ string,from phone number\ string,to phone number\ string,is advertisement\ boolean,trigger type\ string,platform\ string,journey id\ string,journey name\ string,journey step id\ string,journey enrollment id\ string,recurring message id\ string,error\ string>" }, { "name" "kakaoalimtalk", "type" "struct\<campaign id\ string,campaign name\ string,template id\ string,template code\ string,template name\ string,title\ string,body\ string,to phone number\ string,message type\ string,trigger type\ string,journey id\ string,journey name\ string,journey step id\ string,journey enrollment id\ string,recurring message id\ string,platform\ string,error\ string>" }, { "name" "kakaofriendtalk", "type" "struct\<campaign id\ string,campaign name\ string,sender key\ string,body\ string,header\ string,to phone number\ string,message type\ string,is advertisement\ boolean,trigger type\ string,journey id\ string,journey name\ string,journey step id\ string,journey enrollment id\ string,recurring message id\ string,platform\ string,error\ string>" }, { "name" "email", "type" "struct\<campaign id\ string,campaign name\ string,template id\ string,template name\ string,title\ string,from email\ string,to email\ string,trigger type\ string,platform\ string,journey id\ string,journey name\ string,journey step id\ string,journey enrollment id\ string,recurring message id\ string,error\ string>" }, { "name" "iam", "type" "struct\<campaign id\ string,campaign name\ string,group\ string,trigger type\ string,journey id\ string,journey name\ string,journey step id\ string,journey enrollment id\ string,platform\ string,clickable id\ string,dont show minutes\ int>" } ], "partitionkeys" \[ { "name" "projectid", "type" "string" }, { "name" "date", "type" "string" } ], "location" "s3 //\<bucket>/data/", "inputformat" "org apache hadoop hive ql io parquet mapredparquetinputformat", "outputformat" "org apache hadoop hive ql io parquet mapredparquetoutputformat", "serdeinfo" { "serializationlibrary" "org apache hadoop hive ql io parquet serde parquethiveserde", "parameters" { "compression" "snappy" } } } 고객 이벤트 1\ 고객 이벤트 필드 타입 필수 설명 id string required 이벤트 고유 식별자 (ulid) type string required 이벤트 타입 time string required 이벤트 발생 시각 (rfc 3339, utc) projectid string required 플레어레인 프로젝트 식별자 userid string optional 플레어레인 사용자 식별자 (미식별 사용자 시 null) deviceid string optional 플레어레인 기기 식별자 data string optional 이벤트 발행 시 함께 전달한 커스텀 속성 객체 키·값·타입을 자유롭게 정의하는 스키마리스 값으로, 직렬화(stringify)하여 단일 string 컬럼으로 저장 platform string optional 단말 플랫폼 android / ios / webdesktop / webmobile