필터

Overview

Branch는 데스크톱 및 모든 인기 있는 OTT (over-the-top) 플랫폼에 대한 서버 간 (S2S) 측정을 서포트합니다.

이 문서에서는 세션 및 전환 이벤트를 전송하는 방법에 대해 간략하게 설명합니다. 이는 세션이 전환 이벤트와 근본적으로 다르기 때문에 별도입니다. 세션을 로그 하기 위한 Branch에 대한 요청의 응답에는 딥링크 데이터가 포함될 수 있습니다. 유저가 링크를 클릭한 후 앱을 설치하여 열게 되는 "디퍼드 딥링킹" 시나리오를 포함하여 유저를 콘텐츠에 딥링크하는 데 사용할 수 있습니다.

We use Roku as the basis for this guide, but applies to other OTT solutions. We provide an example request (curl), then we discuss each parameter in the request. For specific parameters, we provide tables showing how to change the request based on the platform (e.g. Amazon Fire TV, Apple TV, Samsung Smart TV).

📘

API 액세스가 제한됨

v1/open API를 직접 호출하는 기능은 선정된 엔터프라이즈 계정으로 제한됩니다. 계정에서 사용 가능 여부를 확인하려면 Branch 어카운트 관리자에게 문의하십시오.

전제 조건

  • App is setup in the Branch dashboard with default link redirects, your app.link domains, a URI scheme, Universal Links, and you have access to your API & Secret keys
  • v1/open API에 액세스하도록 계정이 활성화되었습니다.

📘

대시보드 및 인앱 설정 필요

Successful use of the v1/open API will require setup steps in the Branch dashboard and in your mobile or OTT/CTV app.

세션 측정

A session measurement request should be made every time the app is opened. The response should be parsed and a few of the values should be used on subsequent requests (i.e. randomized_device_token, randomized_bundle_token).

세션 요청 파라미터

파라미터유형정의
branch_keyString대시보드 작성 시 제공되는 Branch 키입니다.
branch_secretString대시보드 작성 시 제공되는 Branch secret입니다.
server_to_server불리안(Boolean)요청에 true로 하드코딩 하세요.
app_versionString앱의 의미상 버전 ID
osStringSee platform specific key-value section.
os_versionStringOS 의미상 버전 ID.
retryNumber정수기본값은 0입니다. 요청을 재시도하는 경우 이를 1(첫 번째 재시도) 또는 2(두 번째 재시도)로 설정하세요.
브랜드String디바이스의 브랜드입니다.
모델String디바이스의 모델입니다.
screen_height정수화면의 높이입니다.
screen_width정수화면의 폭입니다.
ad_tracking_enabled불리안(Boolean)Branch가 이 플래그를 사용할 수 있도록 전달되는지 확인하세요.
advertising_idsString → String 맵Should include the appropriate key for the device, and then the value of that advertising ID. See [platform specific key-value section(#session-platform-specific-key-values).
launch_options로쿠만

Map of query params on the launch or input request, as well as other metadata that may be passed to the Roku app as part of these commands.

Example: the following command is issued to your app:
curl -d '' 'http://192.168.0.1:8060/launch/dev?contentId=1234&mediaType=movie'
randomized_device_tokenStringOn initial request (i.e. install), omit this key. Will be returned in the first response (e.g. "randomized_device_token": "123456789123456789"). Then send this up on subsequent requests.
server_to_server_identity불리안(Boolean)Hard code this into the request as true. This generates the randomized_bundle_token for the s2s requests and returns in the response. This needs to be accompanied by identity below.
identityStringOnly works with the server_to_server_identity

이는 s2s 호출을 할 때 developer_id로 매핑되고 설정됩니다. 예 - "test_user_01”
link_identifierStringWhen a URI opens the app, check for a link_click_id
query, and populate with that value (if missing, do not include in request)

Ex. yourapp://open?link_click_id=823569794275788167

세션 플랫폼별 키값

mac_OS

  • os: mac_OS
  • id: MAC address (Media Access Control)
    • 예: "mac_address" : "88:66:5a:2f:81:fa"

WINDOWS

  • os: WINDOWS
  • advertising_ids: windows_advertising_id
    • 예: "windows_advertising_id": "ea31e5e0"
  • id: MAC address (Media Access Control)
    • 예: "mac_address" : "00:1A:C2:7B:00:47"

tv_OS

  • os: tv_OS
  • advertising_ids: idfa
    • 예: "idfa": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"

Roku

  • os: ROKU
  • advertising_ids: roku_rida
    • 예: "roku_rida": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"

SAMSUNG

  • os: SAMSUNG
  • advertising_ids: samsung_ifa
    • 예: "samsung_ifa": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"

LG

  • os: LG
  • advertising_ids: lg_ifa
    • 예: "lg_ifa": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"

PANASONIC

  • os: PANASONIC
  • advertising_ids: panasonic_ifa
    • 예: "panasonic_ifa": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"

XBOX

  • os: XBOX
  • advertising_ids: xbox_msai
    • 예: "xbox_msai": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"

예제 요청

curl -d '{
  "branch_key": "key_live_YOUR_KEY_HERE",
  "app_version": "1.0.1",
  "os": "ROKU",
  "os_version": "10.0",
  "retryNumber": 0,
  "brand": "Roku",
  "model": "4200X",
  "sdk": "roku",
  "sdk_version": "1.0.0",
  "screen_height": 1334,
  "screen_width": 750,
  "ad_tracking_enabled": true,
  "advertising_ids": {
    "roku_rida": "00000000-0000-0000-0000-000000000123"
  },
  "launch_options": {
    "contentID": "1234",
    "instant_on_run_mode": "foreground",
    "lastExitOrTerminationReason": "EXIT_UNKNOWN",
    "mediaType": "movie",
    "source": "external-control",
    "splashTime": "1500"
  },
  "randomized_device_token": "123456789123456789",
  "randomized_bundle_token": "987654321987654321"
}' "https://api2.branch.io/v1/open"

예제 응답

{
  "data": "{\"+clicked_branch_link\":true,\"+is_first_session\":false,\"contentID\":\"1234\",\"mediaType\":\"movie\"}",
  "randomized_device_token": "123456789123456789",
  "randomized_bundle_token": "987654321987654321",
  "session_id": "685187705776489500"
}

NOTE: The deep link data is located inside the object data. It includes +clicked_branch_link: true as well as the link data.

Conversion Event 측정

Conversion Event에는 세션 이외의 모든 항목이 포함됩니다. 여기에는 등록, 텐츠 조회, 구매 등이 포함됩니다.

Standard Event의 경우 다음을 요청하세요. /v2/event/standard

이 목록에 없는 이벤트를 트래킹하려면 커스텀 이벤트를 트래킹하면 됩니다. 이는 써드파티 이벤트 이름에 올바르게 맵핑되지 않음으로 사용 가능한 표준 이벤트가 없는 경우를 위해 폴백이어야 합니다.

📘

Branch Standard Events

For a full list of Branch Standard Events, please see this document.

커스텀 이벤트의 경우 다음을 요청하세요. /v2/event/custom

Conversion Event 요청 매개변수

파라미터유형정의
nameString/v2/event/standard를 사용하는 경우 Standard Event 이름이어야 합니다. 그렇지 않으면 /v2/event/custom을 사용하는 경우 커스텀 이벤트 이름(임의의 string)이 될 수 있습니다.
customer_event_aliasString어떤 string도 괜찮습니다.
branch_keyStringYour branch key, provided upon the time of dashboard creation.

REQUIRED
user_data.developer_identityString유저에 대한 ID입니다.
user_data.app_versionString앱의 의미상 버전 ID
user_data.osStringSee platform specific key-value section.
user_data.os_versionStringOS 의미상 버전 ID.
user_data.brandString디바이스의 브랜드입니다.
user_data.modelString디바이스의 모델입니다.
user_data.screen_height정수화면의 높이입니다.
user_data.screen_width정수화면의 폭입니다.
user_data.environmentStringSee platform specific key-value section.
user_data.limit_ad_tracking불리안(Boolean)Branch가 이 플래그를 사용할 수 있도록 전달되는지 확인하세요. /v1/open-> ad_tracking_enabled의 반대
user_data.advertising_idsString → String 맵Should include the appropriate key for the device, and then the value of that advertising ID. See platform specific key-value section.
user_data.randomized_device_tokenStringOn initial request (i.e. install), omit this key. Will be returned in the first response (e.g. "randomized_device_token": "123456789123456789"). Then send this up on subsequent requests.
event_data.transaction_idString이벤트의 트랜잭션에 대한 ID입니다.
event_data.currencyString (enum)ISO-4217 Currency Codes Only
event_data.revenueDouble / float트랜잭션의 수입 금액입니다.
retryNumber정수기본값은 0입니다. 요청을 재시도하는 경우 이를 1(첫 번째 재시도) 또는 2(두 번째 재시도)로 설정하세요.

Conversion Event 플랫폼별 키값

mac_OS

  • user_data.os: mac_OS
  • user_data.environment: DESKTOP_APP
  • id: MAC address (Media Access Control)
    • 예: "mac_address" : "88:66:5a:2f:81:fa"

WINDOWS

  • user_data.os: WINDOWS
  • user_data.environment: DESKTOP_APP
  • user_data.advertising_ids: windows_advertising_id
    • 예: "windows_advertising_id": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"
  • id: MAC address (Media Access Control)
    • 예: "mac_address" : "00:1A:C2:7B:00:47"

Roku

  • user_data.os: ROKU
  • user_data.environment: TV_APP
  • user_data.advertising_ids: roku_rida
    • 예: "roku_rida": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"

SAMSUNG

  • user_data.os: SAMSUNG
  • user_data.environment: TV_APP
  • user_data.advertising_ids: samsung_ifa
    • 예: "samsung_ifa": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"

LG

  • user_data.os: LG
  • user_data.environment: TV_APP
  • user_data.advertising_ids: lg_ifa
    • 예: "lg_ifa": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"

PANASONIC

  • user_data.os: PANASONIC
  • user_data.environment: TV_APP
  • user_data.advertising_ids: panasonic_ifa
    • 예: "panasonic_ifa": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"

XBOX

  • user_data.os: XBOX
  • user_data.environment: TV_APP
  • user_data.advertising_ids: xbox_msai
    • 예: "xbox_msai": "ea31e5e0-1aa5-4181-91d7-0b56524e0274"

샘플 요청

curl -d '{
  "name": "PURCHASE",
  "customer_event_alias": "purchase 5 tokens",
  "branch_key": "key_live_nezyBshNogxltEUiFjKaDbmkrDlwphCf",
  "user_data": {
    "developer_identity": "user123",
    "app_version": "1.0.1",
    "os": "ROKU",
    "os_version": "10.0",
    "brand": "Roku",
    "model": "4200X",
    "sdk": "roku",
    "sdk_version": "1.0.0",
    "screen_height": 1334,
    "screen_width": 750,
    "environment": "TV_APP",
    "limit_ad_tracking": false,
    "advertising_ids": {
      "roku_rida": "00000000-0000-0000-0000-000000000123"
    },
    "randomized_device_token": "123456789123456789"
  },
  "event_data": {
    "transaction_id": "foobar",
    "currency": "USD",
    "revenue": 100
  },
  "retryNumber": 0
}' "https://api2.branch.io/v2/event/standard"

예제 응답

응답 본문은 검사할 필요가 없습니다. 200 HTTP 상태 코드를 찾기만 하면 됩니다. 2xx가 아닌 상태 코드는 오류를 표시합니다.