事件

ad_impression

當使用者看到一次廣告曝光時,就使用此事件。

  • 使用 Measurement Protocol 傳送的 ad_impression 不會包含在匯出至其他廣告平台 (例如 Google Ads) 的匯出中。
  • 使用 Measurement Protocol 傳送 ad_impression 事件後,如果為連結的 Google 廣告產品設定了代碼或 SDK,可能會導致重複曝光。只有在代碼或 SDK 未擷取事件時,才能使用 Measurement Protocol 傳送 ad_impression 事件。

參數

名稱 類型 需要 範例值 說明
ad_platform string MoPub 廣告平台。
ad_source string AdColony 廣告來源。
ad_format string 橫幅廣告 廣告格式。
ad_unit_name string Banner_03 廣告單元名稱。
currency string USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 歐元
廣告曝光的價值。
* 製作有意義的報表通常需要 value
* 如果設定 value,就必須提供 currency

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events":[{
      "name":"ad_impression",
      "params":{
        "ad_platform": "MoPub",
        "ad_source": "AdColony",
        "ad_format": "Banner",
        "ad_unit_name": "Banner_03",
        "currency": "USD",
        "value": 3.99
      }
    }]
  })
});

add_payment_info

這個事件代表使用者已在電子商務結帳程序中提交付款資訊。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
coupon string SUMMER_FUN 與事件相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
payment_type string 信用卡資訊 選取的付款方式。
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "add_payment_info",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "coupon": "SUMMER_FUN",
        "payment_type": "Credit Card",
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

add_shipping_info

這個事件代表使用者已在電子商務結帳程序中提交運送資訊。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
coupon string SUMMER_FUN 與事件相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
shipping_tier string 陸運 為交付已購買商品而選取的運送層級 (例如 GroundAirNext-day)。
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "add_shipping_info",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "coupon": "SUMMER_FUN",
        "shipping_tier": "Ground",
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

add_to_cart

這個事件代表已將商品加入購物車並購買。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "add_to_cart",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

add_to_wishlist

這個事件表示商品已加入願望清單。請使用這個事件找出應用程式中熱門的禮物。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "add_to_wishlist",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

begin_checkout

這個事件代表使用者已開始結帳。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
coupon string SUMMER_FUN 與事件相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;


fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "begin_checkout",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "coupon": "SUMMER_FUN",
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

campaign_details

使用此事件傳送將套用至未來事件的廣告活動詳細資料。

參數

名稱 類型 需要 範例值 說明
campaign_id string google_1234 廣告活動 ID。
campaign string Summer_fun 用來識別特定促銷或策略性廣告活動的名稱。
source string google 廣告活動流量來源 (例如 Google、電子郵件等)。
medium string cpc 廣告活動媒介 (例如電子郵件、單次點擊出價等)
term string summer+travel 用於提供廣告關鍵字的廣告活動字詞。
content string logolink 用於 A/B 測試和指定內容廣告的廣告活動內容,用來區分連到同一個網址的廣告或連結。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "campaign_details",
      "params": {
        "campaign_id": "google_1234",
        "campaign": "Summer_fun",
        "source": "google",
        "medium": "cpc",
        "term": "summer+travel",
        "content": "logolink"
      }
    }]
  })
});

close_convert_lead

這個事件會評估待開發客戶完成轉換及完成的時間 (例如透過購買)。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "close_convert_lead",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

close_unconvert_lead

用來評估使用者何時未成為已轉換的待開發客戶,以及原因。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
unconvert_lead_reason string 從未回覆 待開發客戶未轉換的原因。
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "close_unconvert_lead",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "unconvert_lead_reason": "Never responded",
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

disqualify_lead

此事件會評估使用者何時標示為不符資格,並成為待開發客戶,以及撤銷資格的原因。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
disqualified_lead_reason string 不打算購買 待開發客戶遭標示為不符資格的原因。
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "disqualify_lead",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "disqualified_lead_reason": "Not looking to buy",
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

earn_virtual_currency

這個事件會評估使用者在遊戲中獲得虛擬貨幣的次數。連同 spend_virtual_currency 記錄這項資料,即可進一步瞭解您的虛擬經濟。

參數

名稱 類型 需要 範例值 說明
virtual_currency_name string Gem 虛擬貨幣的名稱。
value number 5 虛擬貨幣的值。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "earn_virtual_currency",
      "params": {
        "virtual_currency_name": "Gems",
        "value": 5
      }
    }]
  })
});

generate_lead

此事件會評估待開發客戶產生的時間 (例如透過表單)。記錄這份資料以瞭解行銷廣告活動的成效,以及有多少顧客在再行銷後再次與您的商家互動。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
lead_source string 商展 待開發客戶的來源。
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "generate_lead",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "lead_source": "Trade show",
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

join_group

在使用者加入公會、團隊或家庭等群組時記錄此事件。您可以使用這個事件分析特定群組或社交功能的熱門程度。

參數

名稱 類型 需要 範例值 說明
group_id string G_12345 群組 ID。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events":[{
      "name":"join_group",
      "params":{
        "group_id":"G_12345"
      }
    }]
  })
});

level_up

這個事件代表玩家已在遊戲中升級。可用來評估使用者數量的分佈情形,並找出難以完成的關卡。

參數

名稱 類型 需要 範例值 說明
level number 5 字元的等級。
character string 玩家 1 升級的角色。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "level_up",
      "params": {
        "level": 5,
        "character": "Player 1"
      }
    }]
  })
});

登入

傳送這個事件,以表示使用者已登入網站或應用程式。

參數

名稱 類型 需要 範例值 說明
method string Google 登入方式。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "login",
      "params": {
        "method": "Google"
      }
    }]
  })
});

post_score

在使用者張貼得分時傳送這個事件。您可以使用這個事件瞭解使用者在遊戲中的表現,並將高分與目標對像或行為建立關聯。

參數

名稱 類型 需要 範例值 說明
score number 10000 要發布的分數。
level number 5 分數的等級。
character string 玩家 1 獲得分數的字元。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "post_score",
      "params": {
        "score": 10000,
        "level": 5,
        "character": "Player 1"
      }
    }]
  })
});

purchase

這個事件代表使用者購買一或多項商品。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
transaction_id string T_12345 交易的專屬 ID。

transaction_id 參數可避免單筆購買產生重複事件。
coupon string SUMMER_FUN 與事件相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
shipping number 3.33 與交易相關的運費。
tax number 1.11 與交易相關的稅金。
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "purchase",
      "params": {
        "currency": "USD",
        "transaction_id": "T_12345",
        "value": 30.03,
        "coupon": "SUMMER_FUN",
        "shipping": 3.33,
        "tax": 1.11,
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

qualify_lead

此事件用來評估使用者是否符合成為有效待開發客戶的標準。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "qualify_lead",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

refund (退款)

每當有一或多項商品退款給使用者時,就會使用這個事件。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
transaction_id string T_12345 交易的專屬 ID。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
coupon string SUMMER_FUN 與事件相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
shipping number 3.33 與交易相關的運費。
tax number 1.11 與交易相關的稅金。
items Array<Item> 否* 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "refund",
      "params": {
        "currency": "USD",
        "transaction_id": "T_12345",
        "value": 30.03,
        "coupon": "SUMMER_FUN",
        "shipping": 3.33,
        "tax": 1.11,
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

remove_from_cart

這個事件代表已將商品從購物車中移除。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "remove_from_cart",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

screen_view

使用此事件表示畫面轉換已發生。

參數

名稱 類型 需要 範例值 說明
screen_class string MainActivity 畫面的類別。
screen_name string 簡介 畫面名稱。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "screen_view",
      "params": {
        "screen_class": "MainActivity",
        "screen_name": "About"
      }
    }]
  })
});

記錄此事件以指出使用者何時執行搜尋。這個事件可用來找出使用者在網站或應用程式中搜尋的內容。舉例來說,您可以在使用者執行搜尋後瀏覽搜尋結果網頁時,傳送這個事件。

參數

名稱 類型 需要 範例值 說明
search_term string T 恤 搜尋的字詞。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "search",
      "params": {
        "search_term": "t-shirts"
      }
    }]
  })
});

select_content

這個事件表示使用者已選取特定類型的內容。這個事件可協助您找出網站或應用程式中的熱門內容和內容類別。

參數

名稱 類型 需要 範例值 說明
content_type string 產品 所選內容的類型。
content_id string C_12345 所選內容的 ID。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "select_content",
      "params": {
        "content_type": "product",
        "content_id": "C_12345"
      }
    }]
  })
});

select_item

這個事件表示已從清單中選取所需項目。

參數

名稱 類型 需要 範例值 說明
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果在項目層級設定,系統會忽略這個值。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果在項目層級設定,系統會忽略這個值。
items Array<Item> 是* 事件的項目。

* items 陣列應含有單一元素,代表所選項目。如果提供多個元素,系統只會使用 items 中的第一個元素。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "select_item",
      "params": {
        "item_list_id": "related_products",
        "item_list_name": "Related products",
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

select_promotion

此事件代表已選取促銷活動。

參數

名稱 類型 需要 範例值 說明
creative_name string summer_banner2 促銷廣告素材的名稱。

如果在項目層級設定,系統會忽略這個值。
creative_slot string featured_app_1 與活動相關聯的促銷廣告素材版位名稱。

如果在項目層級設定,系統會忽略這個值。
promotion_id string P_12345 與活動相關聯的促銷活動 ID。

如果在項目層級設定,系統會忽略這個值。
promotion_name string 夏季特賣 與活動相關聯的促銷活動名稱。

如果在項目層級設定,系統會忽略這個值。
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "select_promotion",
      "params": {
        "creative_name": "Summer Banner",
        "creative_slot": "featured_app_1",
        "promotion_id": "P_12345",
        "promotion_name": "Summer Sale",
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "creative_name": "summer_banner2",
            "creative_slot": "featured_app_1",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "promotion_id": "P_12345",
            "promotion_name": "Summer Sale",
            "quantity": 3
          }
        ]
      }
    }]
  })
});

分享

當使用者分享內容時,請使用這個事件。

參數

名稱 類型 需要 範例值 說明
method string Twitter 分享內容的方式。
content_type string 圖片 共用內容的類型。
item_id string C_12345 分享內容的 ID。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "share",
      "params": {
        "method": "Twitter",
        "content_type": "image",
        "item_id": "C_12345"
      }
    }]
  })
});

sign_up

這個事件表示使用者已申請帳戶。您可以透過這個事件瞭解已登入和登出使用者的不同行為。

參數

名稱 類型 需要 範例值 說明
method string Google 註冊方式。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "sign_up",
      "params": {
        "method": "Google"
      }
    }]
  })
});

spend_virtual_currency

這個事件會評估您應用程式中的虛擬商品銷售,協助您找出最受歡迎的虛擬商品。

參數

名稱 類型 需要 範例值 說明
value number 5 虛擬貨幣的值。
virtual_currency_name string Gem 虛擬貨幣的名稱。
item_name string 新手道具 採用虛擬貨幣的項目名稱。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "spend_virtual_currency",
      "params": {
        "value": 5,
        "virtual_currency_name": "Gems",
        "item_name": "Starter Boost"
      }
    }]
  })
});

tutorial_begin

此事件代表新手上路程序的開始。請在具有 tutorial_complete 的漏斗中運用這個做法,瞭解有多少使用者完成教學課程。

參數

這個事件沒有建議參數。

這個事件沒有任何參數。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "tutorial_begin"
    }]
  })
});

tutorial_complete

這個事件代表使用者已完成新手上路流程。請在 tutorial_begin 的漏斗中使用這個做法,藉此瞭解有多少使用者完成教學課程。

參數

這個事件沒有建議參數。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "tutorial_complete"
    }]
  })
});

unlock_achievement

在使用者解鎖成就時記錄此事件。這個事件可協助您瞭解使用者如何體驗您的遊戲。

參數

名稱 類型 需要 範例值 說明
achievement_id string A_12345 已解鎖的成就 ID。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "unlock_achievement",
      "params": {
        "achievement_id": "A_12345"
      }
    }]
  })
});

view_cart

這個事件代表使用者查看了購物車。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "view_cart",
      "params": {
        "currency": "USD",
        "value": 7.77,
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

view_item

這個事件代表已向使用者顯示部分內容。使用此事件即可探索使用者瀏覽的最熱銷商品。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "view_item",
      "params": {
        "currency": "USD",
        "value": 7.77,
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ],
      }
    }]
  })
});

view_item_list

系統向使用者顯示特定類型的項目清單時,記錄此事件。

參數

名稱 類型 需要 範例值 說明
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果在項目層級設定,系統會忽略這個值。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果在項目層級設定,系統會忽略這個值。
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "view_item_list",
      "params": {
        "item_list_id": "related_products",
        "item_list_name": "Related products",
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});

view_promotion

這個事件代表使用者曾在清單中瀏覽促銷活動。

參數

名稱 類型 需要 範例值 說明
creative_name string summer_banner2 促銷廣告素材的名稱。

如果在項目層級設定,系統會忽略這個值。
creative_slot string featured_app_1 與活動相關聯的促銷廣告素材版位名稱。

如果在項目層級設定,系統會忽略這個值。
promotion_id string P_12345 與活動相關聯的促銷活動 ID。

如果在項目層級設定,系統會忽略這個值。
promotion_name string 夏季特賣 與活動相關聯的促銷活動名稱。

如果在項目層級設定,系統會忽略這個值。
items Array<Item> 是* 事件的項目。

* items 陣列應含有單一元素,代表與促銷活動相關聯的商品。如果提供多個元素,系統只會使用 items 中的第一個元素。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "view_promotion",
      "params": {
        "creative_name": "Summer Banner",
        "creative_slot": "featured_app_1",
        "promotion_id": "P_12345",
        "promotion_name": "Summer Sale",
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "creative_name": "summer_banner2",
            "creative_slot": "featured_app_1",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "promotion_id": "P_12345",
            "promotion_name": "Summer Sale",
            "quantity": 3
          }
        ]
      }
    }]
  })
});

view_search_results

系統向使用者顯示搜尋結果時,記錄此事件。請注意,您可以透過 Google Analytics (分析) 中的加強型事件評估功能,啟用 view_search_results 事件供自動收集。

參數

名稱 類型 需要 範例值 說明
search_term string 衣物 用於搜尋的字詞。

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "view_search_results",
      "params": {
        "search_term": "Clothing"
      }
    }]
  })
});

working_lead

用來評估使用者聯絡或代表聯絡的使用者。

參數

名稱 類型 需要 範例值 說明
currency string 是* USD 與事件相關聯的項目幣別,採用 3 個字母的 ISO 4217 格式。

* 如已設定 value,則必須使用 currency,才能準確計算收益指標。
value number 是* 30.03 事件的金額。

* 針對 items 中的所有項目,將 value 設為 (price * quantity) 的總和。請勿加入 shippingtax
* 製作有意義的報表通常需要 value。 如果您將事件標示為轉換,建議您設定 value
* 如果設定 value,就必須提供 currency
lead_status string 已發起對話 待開發客戶的狀態。
items Array<Item> 事件的項目。

項目參數

名稱 類型 需要 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*必須擇一提供 item_iditem_name

item_name string 是* 史坦與朋友 T 恤

商品名稱。

*必須擇一提供 item_iditem_name

affiliation string Google 商店 產品關聯,用於指定供貨公司或實體商店地點。
注意:「聯盟」僅適用於項目範圍。
coupon string SUMMER_FUN 與商品相關聯的優待券名稱/代碼。

事件層級與項目層級的 coupon 參數各自獨立。
creative_name string summer_banner2 促銷廣告素材的名稱。

如果已設定,系統會忽略事件層級的 creative_name
如果未設定,則會使用事件層級的 creative_name (如有)。
creative_slot string featured_app_1 與商品相關聯的促銷廣告素材版位名稱。

如果已設定,系統會忽略事件層級的 creative_slot
如果未設定,則會使用事件層級的 creative_slot (如有)。
discount number 2 月 22 日 與商品相關聯的單位折扣金額。
index number 5 項目在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果用做類別階層或分類,這會是第一個類別。
item_category2 string Adult 商品的第二個類別階層或其他分類。
item_category3 string 襯衫 商品的第三個類別階層或其他分類。
item_category4 string 工作人員 商品的第四個類別階層或其他分類。
item_category5 string 短袖 商品的第五個類別階層或其他分類。
item_list_id string related_products 使用者在其中看到商品的清單 ID。

如果已設定,系統會忽略事件層級的 item_list_id
如果未設定,則會使用事件層級的 item_list_id (如有)。
item_list_name string 相關產品 使用者在其中看到商品的清單名稱。

如果已設定,系統會忽略事件層級的 item_list_name
如果未設定,則會使用事件層級的 item_list_name (如有)。
item_variant string green 商品子類、專屬代碼,或是其他商品詳細資料/選項的說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實際地點 (例如實體商店位置)。建議使用與關聯項目對應的 Google 地點 ID。您也可以使用自訂地區 ID。
注意:「位置 ID」僅適用於項目範圍。
price number 10.01 商品的貨幣單位價格,以指定貨幣參數的單位表示。
如果商品適用於折扣,請將 price 設為折扣單位價格,並在 discount 參數中指定單價折扣。
promotion_id string P_12345 與商品相關聯的促銷活動 ID。

如果已設定,系統會忽略事件層級的 promotion_id
如果未設定,則會使用事件層級的 promotion_id (如有)。
promotion_name string 夏季特賣 與商品相關聯的促銷活動名稱。

如果已設定,系統會忽略事件層級的 promotion_name
如果未設定,則會使用事件層級的 promotion_name (如有)。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

除了規定的參數外,還可以在 items 陣列中加入最多 27 個自訂參數

傳送事件

在 GA4 事件建立工具中試用這個事件

const measurementId = `G-XXXXXXXXXX`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "client_id",
    "events": [{
      "name": "working_lead",
      "params": {
        "currency": "USD",
        "value": 30.03,
        "lead_status": "Started conversations",
        "items": [
          {
            "item_id": "SKU_12345",
            "item_name": "Stan and Friends Tee",
            "affiliation": "Google Merchandise Store",
            "coupon": "SUMMER_FUN",
            "currency": "USD",
            "discount": 2.22,
            "index": 0,
            "item_brand": "Google",
            "item_category": "Apparel",
            "item_category2": "Adult",
            "item_category3": "Shirts",
            "item_category4": "Crew",
            "item_category5": "Short sleeve",
            "item_list_id": "related_products",
            "item_list_name": "Related Products",
            "item_variant": "green",
            "location_id": "ChIJIQBpAG2ahYAR_6128GcTUEo",
            "price": 10.01,
            "quantity": 3
          }
        ]
      }
    }]
  })
});