#441 [Feat] 애드픽 쇼핑·핫딜 상품을 광고 재고로 편입 - #454
Merged
Merged
Conversation
- 앱 캠페인은 이 계정 기준 7건이 한계다. os·adtype 을 어떻게 조합해도 늘지 않는다. 쇼핑(30건)과 핫딜(30건) API 를 붙여 재고를 67건으로 늘린다. - 상품의 buyurl 은 이미 affid 가 박힌 완성된 추적 링크라 그대로 쓴다. - 두 API 는 JSON 을 text/html 로 내려준다. 컨텐츠 타입을 믿고 디코딩하면 전부 실패하므로 문자열로 받아 직접 파싱한다. - 상품에는 애드픽이 주는 코드가 없어 buyurl 해시로 식별자를 만든다. 접두사 sh 를 붙여 앱 캠페인의 offer 코드와 섞이지 않게 한다. - 지면은 식별자로 정해 매 동기화마다 옮겨 다니지 않게 한다. - AdSource 를 새로 만들지 않는다. 새 값은 CHECK 제약을 배포 때 직접 ALTER 해야 한다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제
지면을 채울 광고가 부족합니다. 애드픽 앱 캠페인이 이 계정 기준 7건뿐입니다.
파라미터를 바꿔 봐도 늘지 않는 것을 실측으로 확인했습니다.
os생략os=iosos=androidadtype=CPA7건으로는 한 지면밖에 못 채웁니다.
변경
애드픽에는 캠페인 리스트와 별도로 쇼핑·핫딜 API 가 있습니다. 각각 30건씩 내려줍니다.
sdk_shopping.php— 추천 상품 30건sdk_shopping_hotdeal.php— 제휴몰 실시간 핫딜 30건이 둘을 붙여 재고를 7건 → 67건 으로 늘립니다.
buyurl은 이미affid가 박힌 완성된 추적 링크라 그대로 랜딩 URL 로 쓴다.ADPICK_SHOPPING_SLOTS로 조정한다.두 가지 판단
JSON 을 text/html 로 내려줍니다. 컨텐츠 타입만 믿고 디코딩하면 전부 실패해 0건이 됩니다. 문자열로 받아 직접 파싱합니다. 이 때문에 처음 구현이 조용히 0건을 반환했습니다.
AdSource를 새로 만들지 않았습니다. 새 값을 넣으면ck_ad_creatives_sourceCHECK 제약을 배포 때 사람이 직접 ALTER 해야 합니다(ddl-auto=update는 기존 제약을 갱신하지 않음). 상품 편입에 그 운영 절차를 얹을 이유가 없어, 기존ADPICK_API를 쓰되 식별자에sh접두사를 둬 앱 캠페인과 섞이지 않게 했습니다.상품에는 애드픽이 주는 코드가 없어
buyurl해시로 식별자를 만듭니다. 지면도 식별자로 정합니다 — 매 동기화마다 다시 뽑으면 같은 상품이 지면을 옮겨 다녀 노출 집계가 흩어집니다.검증
실제 애드픽 API 로 전체 파이프라인을 돌린 결과입니다.
./gradlew test --tests "com.swyp.picke.domain.ad.*" --tests "com.swyp.picke.global.*" --rerun-tasks→ BUILD SUCCESSFULAdpickCampaignSyncServiceTest10건 통과 (쇼핑 편입·중복 제거·미설정 시 스킵 포함)배포
추가 환경변수는 필요 없습니다.
ADPICK_AFF_ID하나로 캠페인·쇼핑·핫딜이 모두 동작합니다. 지면 분배를 바꾸려면ADPICK_SHOPPING_SLOTS를 설정합니다(기본값: 5개 지면 전체).