-
Notifications
You must be signed in to change notification settings - Fork 0
Advertising Statistics API
주의 : 아래 문서는 현재 API 버전에 적용됩니다. 도메인의 기능은 변경될 수 있습니다. 통계 API는 HTTP 인터페이스로 광고주에게 사용자 획득에 대한 통계치 데이터를 CSV 포맷으로 보여줍니다.
유니티 애즈 통계 API를 사용하기 위해서는 API 키 토큰이 요구됩니다. 이 API 키토큰은 대시보드네서 왼쪽 메뉴에서 Settings 메뉴에서 확인 가능 합니다. 주의 : API 키는 특정 사용자(username)에 만들어집니다. 만약 이 사용자(username)이 organization에서 제거되면 이 API키는 자동으로 유효하지 않게 됩니다. 만약 API키를 제 3자 서비스와 연동하거나 다른 BI의 목적으로 사용할때 이 점을 유념부탁드립니다.
키 토큰은 두가지 방법으로 사용할 수 있습니다.
-
Get request URL에서 apikey 파라메터에 키토큰을 사용합니다. 예를들어 https://stats.unityads.unity3d.com/organizations/:organization_id/reports/acquisiti ons?apikey=
-
Authorization header의 Get request에서 이미 정해진 Bearer과 함께 키토큰을 사용 합니다. 예를들어 curl https://stats.unityads.unity3d.com/organizations/:organization_id/reports/acquisiti ons -H "Authorization: Bearer "
다음 예제는 Get request를 만든다. https://stats.unityads.unity3d.com/organizations/:organizationId/reports/acquisition s?splitBy=campaignSet,country&fields=timestamp,campaignSet,country,clicks,install s,spend&apikey=
다음 파라메터는 request data에서 기간과 범위를 정의해 줍니다.
필터 | 설명 | 예제 |
---|---|---|
Campaign set | 콤마로 구분된 campaign set id | campaignSets=[:campaign_set_id] |
Campaign | 콤마로 구분된 campaign id | campaigns=[:campaign_id] |
Target game | 콤마로 구분된 Target game | targets=[:target_id] |
Source game | 콤마로 구분된 Source game | sources=[:source_id] |
Ad type | 콤마로 구분된 Ad type | adTypes=[(video)] adTypes=[(playable)] adTypes=[(graphic)] |
Country | 콤마로 구분된 Country | countries=[:country_code] |
Store | 콤마로 구분된 Store | stores=[(apple)] stores=[(google)] stores=[(xiaomi)] |
Platform | 콤마로 구분된 Platform | platforms=[(ios)] platforms=[(android)] |
OS version | 콤마로 구분된 OS version | osVersions=[:os_version] |
Creative pack | 콤마로 구분된 Creative pack | campaigns=[:campaign_id] |
Campaign set | 콤마로 구분된 Creative pack | creativePack=[:creativePack_id] |
추가적으로 어떠조건에 의해 데이터를 나누어 콤마리스트를 세분화 할지 정할수 있습니다. splitBy=[(campaignSet|creativePack|adType|campaign|target|source|store|country| platform|osVersion)]
다음은 콤마로 구분된 필드에 어떠한 것을 보여줄지를 정할수 있습니다. fields=[(timestamp|campaignSet|creativePack|adType|campaign|target|source|store |country|platform|osVersion|starts|views|clicks|installs|spend)] (default:all)
주의 : 필드 파라메터를 생략하게 될 경우 모든 필드를 나타나게 합니다.
다음과 같이 분류된 데이터가 csv포맷 형식으로 리턴 됩니다.
- 콤마(,) : field를 분류
- 마침표(.) : 소수점을 의미
- 따옴표("")는 텍스트 필드를 의미
- 새로운줄 문자는 필드내에서 라인을 구별합니다.
campaignSet 데이터를 나누면 두가지 필드로 나누어집니다.
- campaign set id
- campaign set name
campaign 데이터를 나누면 두가지 필드로 나누어집니다.
- campaign id
- campaign name
target 데이터를 나누면 세가지 필드로 나누어집니다.
- target id
- target store id
- target name
주의 : 데이터를 너무 많은 조건으로 나누게 되면 Querying API에 응답하는데 시간이 오래 걸리게 됩니다. 이를 피하기 위해서는 source와 country로 데이터를 나눌때는 한번에 기간 하루만을 query할 것을 추천 드립니다.
$ curl -L "https://stats.unityads.unity3d.com/organizations/:organizationId/reports/acquisitions?split By=campaignSet,country&fields=timestamp,campaignSet,country,clicks,installs,spend&apik ey=" timestamp,campaign set id,campaign set name,country,clicks,installs,spend 2013-03-01T00:00:00.000Z,50ed569d57fe1f324a15fbf7,"Campaign set #5",AU,71,30,45 2013-03-01T00:00:00.000Z,50ed569d57fe1f324a15fbf7,"Campaign set #5",CA,129,88,132 CONFIDENTIAL, Unity Technologies 2017 Advertiser Stats API 2013-03-01T00:00:00.000Z,50ed569d57fe1f324a15fbf7,"Campaign set #5",US,1745,855,1282.5 2013-03-01T00:00:00.000Z,50eeb7339e10c9d21c0225cb,"Campaign set #6",AT,39,19,28.5 2013-03-01T00:00:00.000Z,50eeb7339e10c9d21c0225cb,"Campaign set #6",AU,16,10,15 2013-03-01T00:00:00.000Z,50eeb7339e10c9d21c0225cb,"Campaign set #6",BE,209,120,180