設定目的地和標頭

使用 Data Manager API 時,Destination 概念和要求標頭都會經常出現。請參閱本指南,瞭解如何針對不同情境設定目的地和標頭。

何時該使用目的地或標頭

  • 在擷取要求中使用 Destination。擷取要求會使用 IngestionService 在目標對象中新增或移除成員,或是傳送事件。IngestAudienceMembersRequest 或 IngestEventsRequest 中的 destinations 清單定義了下列項目:

    1. 接收資料的帳戶。例如 Google Ads 帳戶或 Google Analytics 資源。
    2. 帳戶中資料的目標實體,例如 Google Ads 轉換動作或 Google Analytics 資料串流。
    3. 要求憑證的存取路徑,該憑證可存取接收資料的帳戶。

    您可以在同一個擷取要求中加入多個目的地。

  • 在建立、更新、刪除或擷取資源的資源管理要求中使用要求標頭。標頭會定義要求憑證的存取路徑,以存取資源管理要求的目標帳戶。以下列出支援要求標頭的資源管理方法:

舉例來說,如果您想建立目標對象、將成員加入目標對象、檢查診斷結果,然後擷取目標對象來檢查大小,以下是每個步驟、要使用的要求類型,以及是否應使用目的地或要求標頭:

步驟 要求類型 目的地或要求標頭
建立目標對象 資源管理 要求標頭
將成員新增至目標對象 擷取 目的地
查看診斷資訊 擷取 目的地
擷取目標對象 資源管理 要求標頭

按一下每個表格周圍的「擷取」或「資源管理」分頁,即可切換查看本指南中各要求類型的詳細資料。

如果您是廣告主或代理商,請參閱廣告主情境,瞭解如何設定標題及建構 Destination:

如果您是資料合作夥伴,請參閱資料合作夥伴情境,瞭解如何設定標頭及建構 Destination,以便管理資源並將資料傳送至具有合作夥伴連結的帳戶,連結至您的資料合作夥伴帳戶:

「詳細規定」一節深入說明瞭相關規定和驗證規則。

廣告主情境

以下說明如何為廣告主和代理商的常見情境設定 Destination 或要求標頭。這張圖表說明 Data Manager API 如何使用憑證和 Destination 欄位存取廣告主帳戶。

廣告主存取路徑

Google Ads

下圖顯示一組 Google Ads 帳戶和使用者的範例。

Google Ads 帳戶和使用者

管理員帳戶 M1

M1 有兩個直接子帳戶:

  1. 管理員帳戶 M2
  2. 客戶帳戶 C1

Google 帳戶 cloudysanfrancisco@gmail.com 是 M1 的使用者。

管理員帳戶 M2

M2 有兩個直接子帳戶:

  1. 客戶帳戶 C1
  2. 客戶帳戶 C2

Google 帳戶 baklavainthebalkans@gmail.com 是 M2 的使用者。

客戶帳戶 C1

C1 有兩個直接上層管理員帳戶:

  1. 管理員帳戶 M1
  2. 管理員帳戶 M2

Google 帳戶 jeffersonloveshiking@gmail.com 是 C1 的使用者。

客戶帳戶 C2

管理員帳戶 M2 是 C2 的唯一直接上層。

列出的 Google 帳戶都不是 C2 的使用者。

直接存取情境和管理員存取情境說明如何設定目的地,將資料傳送至這些帳戶。

直接存取情境

如要將資料傳送至 Google Ads 帳戶,且您的憑證適用於 Google 帳戶 (該帳戶是 Google Ads 帳戶的使用者):

擷取
目的地
operating_account
account_id Google Ads 帳戶的客戶 ID
account_type GOOGLE_ADS
login_account 請勿設定 login_account,或將其設為與 operating_account 相同的值。
linked_account 請勿設定 linked_account 欄位。
product_destination_id 目標對象或轉換動作的 ID。
資源管理
要求標頭
login-account accountTypes/GOOGLE_ADS/accounts/GOOGLE_ADS_CUSTOMER_ID
linked-account 請勿設定 linked-account 標頭。

以下是直接存取情境的範例,使用圖表中的帳戶和 Google 帳戶 jeffersonloveshiking@gmail.com 的憑證:

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "C1_CUSTOMER_ID",
        "accountType": "GOOGLE_ADS"

      },
      "loginAccount": {
        "accountId": "C1_CUSTOMER_ID",
        "accountType": "GOOGLE_ADS"

      },
      "productDestinationId": "USER_LIST_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/GOOGLE_ADS/accounts/C1_CUSTOMER_ID
linked-account 請勿設定 linked-account 標頭。

管理員存取權情境

如要將資料傳送至 Google Ads 帳戶,且您的憑證適用於 Google Ads 管理員帳戶中的使用者 Google 帳戶,而廣告主帳戶是子帳戶:

擷取
目的地
operating_account
account_id Google Ads 客戶帳戶的客戶 ID
account_type GOOGLE_ADS
login_account
account_id Google Ads 管理員帳戶的客戶 ID
account_type GOOGLE_ADS
linked_account 請勿設定 linked_account 欄位。
product_destination_id 目標對象或轉換動作的 ID。
資源管理
要求標頭
login-account accountTypes/GOOGLE_ADS/accounts/MANAGER_CUSTOMER_ID
linked-account 請勿設定 linked-account 標頭。

以下是 Google Ads 客戶帳戶 C2 的管理員存取權情境範例 (請參閱圖表),以及 Google 帳戶 baklavainthebalkans@gmail.com 的憑證:

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "C2_CUSTOMER_ID",
        "accountType": "GOOGLE_ADS"
      },
      "loginAccount": {
        "accountId": "M2_CUSTOMER_ID",
        "accountType": "GOOGLE_ADS"
      },
      "productDestinationId": "USER_LIST_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/GOOGLE_ADS/accounts/M2_CUSTOMER_ID
linked-account 請勿設定 linked-account 標頭。

以下是另一個範例,說明 Google Ads 客戶帳戶 C2 的管理員存取權情境,以及 Google 帳戶 cloudysanfrancisco@gmail.com 的憑證,該帳戶是 Google Ads 管理員帳戶 M1 的使用者:

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "C2_CUSTOMER_ID",
        "accountType": "GOOGLE_ADS"
      },
      "loginAccount": {
        "accountId": "M1_CUSTOMER_ID",
        "accountType": "GOOGLE_ADS"
      },
      "productDestinationId": "USER_LIST_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/GOOGLE_ADS/accounts/M1_CUSTOMER_ID
linked-account 請勿設定 linked-account 標頭。

Display & Video 360

您可以透過兩種方式將資料傳送至 Display & Video 360:

  1. 直接存取:憑證適用於 Display & Video 360 廣告主或夥伴帳戶中的使用者 Google 帳戶。
  2. Display & Video 360 夥伴存取權,其中憑證適用於 Google 帳戶 (該帳戶是 Display & Video 360 夥伴帳戶中的使用者),而作業帳戶是夥伴帳戶下的 Display & Video 360 廣告主帳戶。

直接存取情境

如要將資料傳送至 Display & Video 360 廣告主帳戶,且您的憑證適用於廣告主帳戶中的使用者 Google 帳戶:

擷取
目的地
operating_account
account_id Display & Video 360 廣告主帳戶的 ID
account_type DISPLAY_VIDEO_ADVERTISER
login_account 請勿設定 login_account,或將其設為與 operating_account 相同的值。
linked_account 請勿設定 linked_account 欄位。
product_destination_id 目標對象的 ID。
資源管理
要求標頭
login-account accountTypes/DISPLAY_VIDEO_ADVERTISER/accounts/DISPLAY_VIDEO_ADVERTISER_ID
linked-account 請勿設定 linked-account 標頭。

以下是直接存取情境的 Destination 範例,可將資料傳送至 Display & Video 360 廣告主:

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "DISPLAY_VIDEO_ADVERTISER_ID",
        "accountType": "DISPLAY_VIDEO_ADVERTISER"
      },
      "loginAccount": {
        "accountId": "DISPLAY_VIDEO_ADVERTISER_ID",
        "accountType": "DISPLAY_VIDEO_ADVERTISER"
      },
      "productDestinationId": "AUDIENCE_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/DISPLAY_VIDEO_ADVERTISER/accounts/DISPLAY_VIDEO_ADVERTISER_ID
linked-account 請勿設定 linked-account 標頭。

同樣地,如要將資料傳送至 Display & Video 360 夥伴帳戶,且您的憑證適用於夥伴帳戶中的使用者 Google 帳戶:

擷取
目的地
operating_account
account_id Display & Video 360 合作夥伴帳戶的 ID
account_type DISPLAY_VIDEO_PARTNER
login_account 請勿設定 login_account,或將其設為與 operating_account 相同的值。
linked_account 請勿設定 linked_account 欄位。
product_destination_id 目標對象的 ID。
資源管理
要求標頭
login-account accountTypes/DISPLAY_VIDEO_PARTNER/accounts/DISPLAY_VIDEO_PARTNER_ID
linked-account 請勿設定 linked-account 標頭。

以下是Destination的範例,說明如何直接存取資料,並將資料傳送至 Display & Video 360 合作夥伴:

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "DISPLAY_VIDEO_PARTNER_ID",
        "accountType": "DISPLAY_VIDEO_PARTNER"
      },
      "loginAccount": {
        "accountId": "DISPLAY_VIDEO_PARTNER_ID",
        "accountType": "DISPLAY_VIDEO_PARTNER"
      },
      "productDestinationId": "AUDIENCE_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/DISPLAY_VIDEO_PARTNER/accounts/DISPLAY_VIDEO_PARTNER_ID
linked-account 請勿設定 linked-account 標頭。

Display & Video 360 合作夥伴存取情境

如要將資料傳送至 Display & Video 360 廣告主,且您的憑證適用於廣告主上層 Display & Video 360 合作夥伴帳戶中的 Google 帳戶使用者:

擷取
目的地
operating_account
account_id Display & Video 360 廣告主帳戶的 ID
account_type DISPLAY_VIDEO_ADVERTISER
login_account
account_id Display & Video 360 合作夥伴帳戶的 ID
account_type DISPLAY_VIDEO_PARTNER
linked_account 請勿設定 linked_account 欄位。
product_destination_id 目標對象的 ID。
資源管理
要求標頭
login-account accountTypes/DISPLAY_VIDEO_PARTNER/accounts/DISPLAY_VIDEO_PARTNER_ID
linked-account 請勿設定 linked-account 標頭。

以下是合作夥伴存取情境的 Destination 範例,可將資料傳送至 Display & Video 360 廣告主。在這種情況下,憑證必須是 Google 帳戶的憑證,且該帳戶是 Display & Video 360 合作夥伴帳戶 DISPLAY_VIDEO_PARTNER_ID 的使用者,而 Display & Video 360 廣告主帳戶 DISPLAY_VIDEO_ADVERTISER_ID 必須是合作夥伴帳戶 DISPLAY_VIDEO_PARTNER_ID 的子項。

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "DISPLAY_VIDEO_ADVERTISER_ID",
        "accountType": "DISPLAY_VIDEO_ADVERTISER"
      },
      "loginAccount": {
        "accountId": "DISPLAY_VIDEO_PARTNER_ID",
        "accountType": "DISPLAY_VIDEO_PARTNER"
      },
      "productDestinationId": "AUDIENCE_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/DISPLAY_VIDEO_PARTNER/accounts/DISPLAY_VIDEO_PARTNER_ID
linked-account 請勿設定 linked-account 標頭。

Google Analytics

附註:如果 operating_account 是 Google Analytics 帳戶,請勿設定 login_account,或將 login_account 設為與 operating_account 相同的值。否則要求會失敗,並顯示 OPERATING_ACCOUNT_LOGIN_ACCOUNT_MISMATCH 錯誤。

擷取
目的地
operating_account
account_id Google Analytics 資源的 ID
account_type GOOGLE_ANALYTICS_PROPERTY
login_account 請勿設定 login_account,或將其設為與 operating_account 相同的值。
linked_account 請勿設定 linked_account 欄位。
product_destination_id
資源管理
要求標頭
login-account accountTypes/GOOGLE_ANALYTICS_PROPERTY/accounts/PROPERTY_ID
linked-account 請勿設定 linked-account 標頭。

以下是Destination的範例,用於將事件傳送至 Google Analytics:

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "PROPERTY_ID",
        "accountType": "GOOGLE_ANALYTICS_PROPERTY"
      },
      "loginAccount": {
        "accountId": "PROPERTY_ID",
        "accountType": "GOOGLE_ANALYTICS_PROPERTY"
      },
      "productDestinationId": "MEASUREMENT_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/GOOGLE_ANALYTICS_PROPERTY/accounts/PROPERTY_ID
linked-account 請勿設定 linked-account 標頭。

泛光燈

擷取
目的地
operating_account
account_id Floodlight 設定 ID
如果您的廣告主是上層廣告主的子項,請使用 Campaign Manager 360 中的上層廣告主 ID 做為 Floodlight 設定 ID。否則請使用廣告主的 ID。 瞭解如何在 Campaign Manager 360 使用者介面中找出廣告主 ID。
account_type FLOODLIGHT_CONFIG
login_account 請勿設定 login_account,或將其設為與 operating_account 相同的值。
linked_account 請勿設定 linked_account 欄位。
product_destination_id Floodlight 活動 ID

以下是將事件傳送至 Floodlight 的 Destination 範例:

擷取
        {
          "destinations": [
            {
              "operatingAccount": {
                "accountId": "FLOODLIGHT_CONFIG_ID",
                "accountType": "FLOODLIGHT_CONFIG"
              },
              "loginAccount": {
                "accountId": "FLOODLIGHT_CONFIG_ID",
                "accountType": "FLOODLIGHT_CONFIG"
              },
              "productDestinationId": "FLOODLIGHT_ACTIVITY_ID"
            }
          ]
        }
      

資料合作夥伴情境

以下說明如何為資料合作夥伴設定 Destination,以因應常見情境,將資料傳送至與資料合作夥伴帳戶建立合作夥伴連結的廣告主帳戶。

此圖表顯示 Data Manager API 如何使用憑證和 Destination 欄位,透過合作夥伴連結存取廣告主帳戶。

資料合作夥伴存取路徑

Google Ads

下圖顯示一組 Google Ads 和資料合作夥伴帳戶的範例。這張圖表也會顯示每個 Google Ads 或資料合作夥伴帳戶中的使用者所屬的 Google 帳戶,以及帳戶之間的合作夥伴連結。

資料合作夥伴、Google Ads 帳戶和使用者

資料合作夥伴 D1

D1 和 Google Ads 管理員帳戶 M2 之間存在合作夥伴連結。

Google 帳戶 222larabrown@gmail.com 是 D1 的使用者。

資料合作夥伴 D2

D2 與 Google Ads 客戶帳戶 C1 之間存在合作夥伴連結。

Google 帳戶 jeffersonloveshiking@gmail.com 是 D2 的使用者。

管理員帳戶 M1

M1 有兩個直接子帳戶:

  1. 管理員帳戶 M2
  2. 客戶帳戶 C1
管理員帳戶 M2

M2 有兩個直接子帳戶:

  1. 客戶帳戶 C1
  2. 客戶帳戶 C2
客戶帳戶 C1

C1 有兩個直接上層管理員帳戶:

  1. 管理員帳戶 M1
  2. 管理員帳戶 M2
客戶帳戶 C2

管理員帳戶 M2 是 C2 的唯一直接上層。

這組帳戶的用途如下:

扮演資料合作夥伴 D1

如要擔任資料合作夥伴 D1,請使用 Google 帳戶222larabrown@gmail.com的憑證,透過目的地將資料傳送至管理員帳戶 M2、客戶帳戶 C1 或客戶帳戶 C2,並將 login_account 設為資料合作夥伴帳戶 D1,以及將 linked_account 設為管理員帳戶 M2。

資料合作夥伴 D1 無法將資料傳送至管理員帳戶 M1,因為 D1 和 M1 之間沒有合作夥伴連結。

扮演資料合作夥伴 D2

如要擔任資料合作夥伴 D2,請使用 Google 帳戶的憑證 jeffersonloveshiking@gmail.com,透過目的地將資料傳送至客戶帳戶 C1,並將 login_account 設為資料合作夥伴帳戶 D2,以及將 linked_account 設為客戶帳戶 C1。

資料合作夥伴 D2 無法將資料傳送至管理員帳戶 M1、管理員帳戶 M2 或客戶帳戶 C2,因為 D2 與這些帳戶或其上層管理員帳戶之間沒有合作夥伴連結。

資料合作夥伴 D1 和 D2 的主要差異在於資料合作夥伴與 Google Ads 帳戶的連結方式。

直接合作夥伴連結情境

如要將資料傳送至 Google Ads 帳戶,且 Google Ads 帳戶與資料合作夥伴帳戶之間有合作夥伴連結:

擷取
目的地
operating_account
account_id Google Ads 帳戶的客戶 ID
account_type GOOGLE_ADS
login_account
account_id 資料合作夥伴帳戶的客戶 ID
account_type DATA_PARTNER
linked_account 請勿設定 linked_account 欄位。
product_destination_id 目標對象或轉換動作的 ID。
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/DATA_PARTNER_ID
linked-account 請勿設定 linked-account 標頭。

以下是使用圖表中的帳戶,直接連結合作夥伴的範例情境,以及資源管理要求的對應要求標頭。在這種情況下,資料合作夥伴 D2 會使用 D2 和 C1 之間的合作夥伴連結,以及 Google 帳戶 jeffersonloveshiking@gmail.com 的憑證,將目標對象成員資料傳送給 Google Ads 客戶 C1:

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "C1_CUSTOMER_ID",
        "accountType": "GOOGLE_ADS"
      },
      "loginAccount": {
        "accountId": "D2_CUSTOMER_ID",
        "accountType": "DATA_PARTNER"
      },
      "productDestinationId": "USER_LIST_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/D2_CUSTOMER_ID
linked-account 請勿設定 linked-account 標頭。

管理員合作夥伴連結情境

如要將資料傳送至 Google Ads 帳戶,且合作夥伴連結位於父項 Google Ads 管理員帳戶和資料合作夥伴帳戶之間:

擷取
目的地
operating_account
account_id Google Ads 客戶帳戶的客戶 ID
account_type GOOGLE_ADS
login_account
account_id 資料合作夥伴帳戶的客戶 ID
account_type DATA_PARTNER
linked_account
account_id Google Ads 管理員帳戶的客戶 ID
account_type GOOGLE_ADS
product_destination_id 目標對象或轉換動作的 ID。
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/DATA_PARTNER_ID
linked-account accountTypes/GOOGLE_ADS/accounts/MANAGER_CUSTOMER_ID

以下是管理員合作夥伴連結情境範例,使用圖表中的帳戶。在這個情境中,資料合作夥伴 D1 會透過 D1 和 M2 之間的合作夥伴連結,以及 Google 帳戶 222larabrown@gmail.com 的憑證,將目標對象成員資料傳送給 Google Ads 客戶 C2:

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "C2_CUSTOMER_ID",
        "accountType": "GOOGLE_ADS"
      },
      "loginAccount": {
        "accountId": "D1_CUSTOMER_ID",
        "accountType": "DATA_PARTNER"
      },
      "linkedAccount": {
        "accountId": "M2_CUSTOMER_ID",
        "accountType": "GOOGLE_ADS"
      },
      "productDestinationId": "USER_LIST_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/D1_CUSTOMER_ID
linked-account accountTypes/GOOGLE_ADS/accounts/M2_CUSTOMER_ID

Display & Video 360

資料合作夥伴可以透過兩種方式,將資料傳送至 Display & Video 360 帳戶:

  1. 在資料合作夥伴帳戶與 Display & Video 360 夥伴或廣告主帳戶之間,使用直接夥伴連結。
  2. 使用資料合作夥伴帳戶與廣告主上層 Display & Video 360 合作夥伴帳戶之間的合作夥伴連結,將資料傳送給 Display & Video 360 廣告主。

如要將資料傳送至 Display & Video 360 廣告主,且 合作夥伴連結位於 Display & Video 360 廣告主帳戶和您的資料合作夥伴帳戶之間:

擷取
目的地
operating_account
account_id Display & Video 360 廣告主帳戶的 ID
account_type DISPLAY_VIDEO_ADVERTISER
login_account
account_id 資料合作夥伴帳戶的客戶 ID
account_type DATA_PARTNER
linked_account 請勿設定 linked_account 欄位。
product_destination_id 目標對象或轉換動作的 ID。
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/DATA_PARTNER_ID
linked-account 請勿設定 linked-account 標頭。

以下是直接合作夥伴連結情境的 Destination 範例,可將資料傳送至 Display & Video 360 廣告主,以及資源管理要求的對應要求標頭:

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "DISPLAY_VIDEO_ADVERTISER_ID",
        "accountType": "DISPLAY_VIDEO_ADVERTISER"
      },
      "loginAccount": {
        "accountId": "DATA_PARTNER_ID",
        "accountType": "DATA_PARTNER"
      },
      "productDestinationId": "AUDIENCE_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/DATA_PARTNER_ID
linked-account 請勿設定 linked-account 標頭。

如要將資料傳送至 Display & Video 360 合作夥伴帳戶,您必須在 Display & Video 360 合作夥伴帳戶和資料合作夥伴帳戶之間建立合作夥伴連結。

擷取
目的地
operating_account
account_id Display & Video 360 合作夥伴帳戶的 ID
account_type DISPLAY_VIDEO_PARTNER
login_account
account_id 資料合作夥伴帳戶的客戶 ID
account_type DATA_PARTNER
linked_account 請勿設定 linked_account 欄位。
product_destination_id 目標對象或轉換動作的 ID。
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/DATA_PARTNER_ID
linked-account 請勿設定 linked-account 標頭。

以下是直接合作夥伴連結情境的 Destination 範例,可將資料傳送至 Display & Video 360 合作夥伴,以及資源管理要求的對應要求標頭:

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "DISPLAY_VIDEO_PARTNER_ID",
        "accountType": "DISPLAY_VIDEO_PARTNER"
      },
      "loginAccount": {
        "accountId": "DATA_PARTNER_ID",
        "accountType": "DATA_PARTNER"
      },
      "productDestinationId": "AUDIENCE_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/DATA_PARTNER_ID
linked-account 請勿設定 linked-account 標頭。

如要將資料傳送至 Display & Video 360 廣告主,且與資料合作夥伴帳戶的合作夥伴連結是透過 Display & Video 360 合作夥伴帳戶 (廣告主帳戶是子項帳戶):

擷取
目的地
operating_account
account_id Display & Video 360 廣告主帳戶的 ID
account_type DISPLAY_VIDEO_ADVERTISER
login_account
account_id 資料合作夥伴帳戶的客戶 ID
account_type DATA_PARTNER
linked_account
account_id Display & Video 360 合作夥伴帳戶的 ID
account_type DISPLAY_VIDEO_PARTNER
product_destination_id 目標對象或轉換動作的 ID。
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/DATA_PARTNER_ID
linked-account accountTypes/DISPLAY_VIDEO_PARTNER/accounts/DISPLAY_VIDEO_PARTNER_ID

以下是Destination的範例,說明如何透過資料合作夥伴與廣告主上層 Display & Video 360 夥伴之間的夥伴連結,將資料傳送至 Display & Video 360 廣告主:

擷取
{
  "destinations": [
    {
      "operatingAccount": {
        "accountId": "DISPLAY_VIDEO_ADVERTISER_ID",
        "accountType": "DISPLAY_VIDEO_ADVERTISER"
      },
      "loginAccount": {
        "accountId": "DATA_PARTNER_ID",
        "accountType": "DATA_PARTNER"
      },
      "linkedAccount": {
        "accountId": "DISPLAY_VIDEO_PARTNER_ID",
        "accountType": "DISPLAY_VIDEO_PARTNER"
      },
      "productDestinationId": "AUDIENCE_ID"
    }
  ]
}
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/DATA_PARTNER_ID
linked-account accountTypes/DISPLAY_VIDEO_PARTNER/accounts/DISPLAY_VIDEO_PARTNER_ID

Google Ad Manager

如要將資料傳送至 Google Ad Manager 帳戶,且資料合作夥伴帳戶與 Google Ad Manager 帳戶之間有合作夥伴連結:

擷取
目的地
operating_account
account_id Google Ad Manager 帳戶的目標對象連結 ID
account_type GOOGLE_AD_MANAGER_AUDIENCE_LINK
login_account
account_id 資料合作夥伴帳戶的客戶 ID
account_type DATA_PARTNER
linked_account 請勿設定 linked_account 欄位。
product_destination_id 目標對象的 ID。
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/DATA_PARTNER_ID
linked-account 請勿設定 linked-account 標頭。

以下範例說明如何使用合作夥伴連結,將資料傳送至 Google Ad Manager 帳戶:Destination

擷取
      {
        "destinations": [
          {
            "operatingAccount": {
              "accountId": "GAM_AUDIENCE_LINK_ID",
              "accountType": "GOOGLE_AD_MANAGER_AUDIENCE_LINK"
            },
            "loginAccount": {
              "accountId": "DATA_PARTNER_ID",
              "accountType": "DATA_PARTNER"
            },
            "productDestinationId": "AUDIENCE_ID"
          }
        ]
      }
      
資源管理
要求標頭
login-account accountTypes/DATA_PARTNER/accounts/DATA_PARTNER_ID
linked-account 請勿設定 linked-account 標頭。

Google Analytics

Data Manager API 不支援使用合作夥伴連結將資料傳送至 Google Analytics 帳戶。請改用廣告主情境的 Google Analytics 方法。

泛光燈

Data Manager API 不支援使用合作夥伴連結將資料傳送至 Floodlight 設定。請改用「廣告主情境的 Floodlight」方法。

詳細規定

本節詳細說明 Destination 的帳戶欄位要求,以及資源管理要求的對等要求標頭、設定 product_destination_id 的提示,以及如何判斷憑證可存取的位置。IngestionService

帳戶欄位

一個 Destination 最多可有 3 個不同帳戶:

operating_account

operating_account為必填欄位。

operating_account 會指出要求中的資料接收帳戶。operating_account 可以是下列任一值:

沒有與 Destination 的 operating_account 欄位對應的要求標頭。傳送資源管理要求時,要求目標帳戶為作業帳戶。

login_account 欄位和 login-account 要求標頭

login_account 不一定需要,預設為 IngestionService 要求中的 operating_account,以及資源管理要求中的目標帳戶。在資源管理要求中,使用 login-account 要求標頭識別登入帳戶。

Data Manager API 會驗證下列事項:

  1. 憑證的 Google 帳戶是登入帳戶中的使用者。

  2. 登入帳戶為下列其中之一:

linked_account 欄位和 linked-account 要求標頭

linked_account 表示哪個帳戶有合作夥伴連結至 login_account 的 IngestionService 要求,或是資源管理要求中的目標帳戶。

產品目的地 ID

Destination 的 product_destination_id 會識別 operating_account 中的哪個物件接收資料。例如 Google Ads 或 Display & Video 360 的目標對象 ID、Google Ads 的轉換動作 ID,或是 Google Analytics 資料串流的評估 ID。

以下說明如何找出各類型產品目的地 ID。

Google Ads 目標對象

如要擷取目標對象成員,產品目的地 ID 就是目標對象 ID。 您可以使用 Google Ads UI 或 Data Manager API 擷取這個 ID。

如要透過 Google Ads 使用者介面取得目標對象 ID,請按照下列步驟操作:

  1. 前往 Google Ads 使用者介面的「目標對象管理工具」 。
  2. 按一下目標對象名稱即可查看詳細資料。
  3. 目標對象 ID 會列在「名單 ID」旁邊。

Data Manager API

使用 List 方法擷取 UserList,視需要提供要求標頭,並使用產品目的地 ID 的 UserList id。

Google Ads 事件

用於擷取事件的產品目的地 ID 是轉換動作 ID。 您可以使用 Google Ads 使用者介面或 Google Ads API 擷取這個 ID。

如要透過 Google Ads 使用者介面取得轉換動作 ID,請按照下列步驟操作:

  1. 前往 Google Ads 使用者介面的「轉換」。
  2. 按一下轉換動作名稱。
  3. 前往「詳細資料」分頁。
  4. 轉換動作 ID 是「轉換類型 ID」旁的數字。

如要透過 Google Ads API 取得轉換動作 ID,請按照下列步驟操作:

  1. 將 Search 或 SearchStream 要求傳送至 GoogleAdsService 並附上下列查詢:

      SELECT
        conversion_action.id,
        conversion_action.name
      FROM conversion_action
      WHERE conversion_action.name = 'CONVERSION_ACTION_NAME'
    
  2. 從回應中 conversion_action 的 id 欄位取得轉換動作 ID。

      [
        {
          "results": [
            {
              "conversionAction": {
                "resourceName": "customers/CUSTOMER_ID/conversionActions/CONVERSION_ACTION_ID",
                "id": "CONVERSION_ACTION_ID",
                "name": "CONVERSION_ACTION_NAME"
              }
            }
          ]
        }
      ]
    

Display & Video 360 目標對象

如要擷取目標對象成員,產品目的地 ID 就是目標對象 ID。 您可以使用 Display & Video 360 使用者介面或 Data Manager API 擷取這個 ID。

Display & Video 360 使用者介面

如要從 Display & Video 360 使用者介面取得目標對象 ID,請按照下列步驟操作:

  1. 前往 https://displayvideo.google.com 登入 Display & Video 360 使用者介面。
  2. 前往您用於operating_account的 Display & Video 360 夥伴或廣告主。
  3. 前往左選單中的「目標對象」,然後選取「所有目標對象」。
  4. 在清單中找出目標對象。目標對象 ID 是「名稱」欄中名稱旁邊的數字。

Data Manager API

使用 List 方法擷取 UserList,視需要提供要求標頭,並使用產品目的地 ID 的 id UserList。

Google Analytics 事件

產品目的地 ID 取決於資料串流類型。

網站資料串流
使用資料串流的評估 ID。
應用程式資料串流

使用資料串流的 Firebase 應用程式 ID。以下提供兩種方法,可找出 Firebase 應用程式 ID:

  • 在 Google Analytics 使用者介面中,前往「資料串流」,按一下資料串流,然後尋找「FIREBASE 應用程式 ID」。
  • 使用 Firebase 控制台。

Floodlight 事件

如要將事件匯入 Floodlight,產品目的地 ID 為 Floodlight 活動 ID。您可以使用 Campaign Manager 360 使用者介面或 Campaign Manager 360 API 擷取這個 ID。

Campaign Manager 360 使用者介面

如要透過 Campaign Manager 360 使用者介面取得 Floodlight 活動 ID,請按照下列步驟操作:

  1. 登入 Campaign Manager 360 使用者介面。
  2. 前往您用於operating_account的 Campaign Manager 360 廣告主。
  3. 前往左選單的「Floodlight」,然後選取「活動」。
  4. 在清單中找出 Floodlight 活動。ID 是「活動名稱」欄中名稱旁邊的數字。

Campaign Manager 360 API

如要透過 Campaign Manager 360 API 取得 Floodlight 活動 ID,請按照下列步驟操作:

  1. 將 list 要求傳送至 floodlightActivities 資源。
  2. 指定 Floodlight 設定的 floodlightConfigurationId。
  3. (選用) 使用 searchString 參數依活動名稱篩選。
  4. 從回應中選取 FloodlightActivity 的 id 欄位,取得 Floodlight 活動 ID。

判斷憑證的存取權

您用來授權 Data Manager API 要求的憑證會與特定 Google 帳戶建立關聯。

  • 如果您使用使用者憑證,系統會將要求授權為 Google 帳戶,也就是在您產生憑證時,授權代表他們採取行動的使用者帳戶。
  • 如果您使用服務帳戶憑證,系統會將要求授權為服務帳戶的 Google 帳戶。

以下說明如何確認憑證的 Google 帳戶是否能存取 Google Ads、Display & Video 360、Google Analytics 或 Campaign Manager 360 帳戶。

Google Ads 或資料合作夥伴

  1. 前往 Google Ads 使用者介面中的「存取權和安全性」login_account。
  2. 選取 [Users] (使用者) 分頁標籤。
  3. 如果 login_account 是 Google Ads 管理員帳戶,請關閉「以完整階層顯示使用者」切換按鈕,隱藏子帳戶的使用者。
  4. 確認憑證的 Google 帳戶位於「使用者」分頁中顯示的帳戶清單。

Display & Video 360

  1. 前往 Display & Video 360 使用者介面的「使用者管理和電子郵件接收設定」。
  2. 確認「使用者管理」顯示您憑證的 Google 帳戶是 login_account 的使用者。

Google Analytics

  1. 前往 Google Analytics 使用者介面的「資源存取管理」。
  2. 確認已選取 login_account 中指定的 Google Analytics 資源。
  3. 確認憑證的 Google 帳戶具備資源的「編輯者」或「管理員」角色。

Floodlight (Campaign Manager 360)

  1. 登入 Campaign Manager 360 使用者介面。
  2. 在左選單中,依序前往「管理員」 >「使用者設定檔」。
  3. 確認憑證的 Google 帳戶位於顯示的設定檔清單中。
  4. 按一下設定檔,確認該設定檔有權存取用做login_account的廣告主帳戶。如果未在要求中設定 login_account,系統會預設為 operating_account。請確認帳戶的使用者角色具備「插入離線轉換」權限。