事件

ad_impression

這項事件僅適用於應用程式串流。

使用者看到廣告曝光時,請使用這個事件。

  • 使用 Measurement Protocol 傳送的 ad_impression不會納入匯出至其他廣告平台 (例如 Google Ads) 的資料。
  • 如果您已為已連結的 Google 廣告產品設定代碼或 SDK,使用 Measurement Protocol 傳送 ad_impression 事件可能會導致曝光次數重複計算。只有在標記或 SDK 未擷取到事件時,才使用 Measurement Protocol 傳送 ad_impression 事件。

參數

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

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

傳送事件

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

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({
    "app_instance_id": "app_instance_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 是* 美元 與事件相關聯的項目幣別,採用3 個字母的 ISO 4217 格式。

view_item 事件的價值指標不會計入收益

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

* 將 value 設為 (price * quantity) 中所有項目的總和,這些項目位於 items 中。請勿加入 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 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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 是* 美元 與事件相關聯的項目幣別,採用3 個字母的 ISO 4217 格式。

view_item 事件的價值指標不會計入收益

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

* 將 value 設為 (price * quantity) 中所有項目的總和,這些項目位於 items 中。請勿加入 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 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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 是* 美元 與事件相關聯的項目幣別,採用3 個字母的 ISO 4217 格式。

view_item 事件的價值指標不會計入收益

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

* 將 value 設為 (price * quantity) 中所有項目的總和,這些項目位於 items 中。請勿加入 shippingtax
* 通常需要 value 才能產生有意義的報表。 如果將事件標示為重要事件,建議您設定 value
* 如已設定 value,則必須設定 currency
items Array<Item> 活動項目。

項目參數

名稱 類型 必填 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*請提供 item_iditem_name 其中之一。

item_name string 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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 是* 美元 與事件相關聯的項目幣別,採用3 個字母的 ISO 4217 格式。

view_item 事件的價值指標不會計入收益

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

* 將 value 設為 (price * quantity) 中所有項目的總和,這些項目位於 items 中。請勿加入 shippingtax
* 通常需要 value 才能產生有意義的報表。 如果將事件標示為重要事件,建議您設定 value
* 如已設定 value,則必須設定 currency
items Array<Item> 活動項目。

項目參數

名稱 類型 必填 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*請提供 item_iditem_name 其中之一。

item_name string 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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 是* 美元 與事件相關聯的項目幣別,採用3 個字母的 ISO 4217 格式。

view_item 事件的價值指標不會計入收益

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

* 將 value 設為 (price * quantity) 中所有項目的總和,這些項目位於 items 中。請勿加入 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 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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 測試和指定內容廣告的廣告活動內容,可區分連到同一個網址的不同廣告或連結。

傳送事件

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

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 是* 美元 活動 value 的幣別,採 3 個英文字母組成的 ISO 4217 格式。

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

* value 通常是產生有意義報表的必要條件。 如果將事件標示為重要事件,建議您設定 value
* 如已設定 value,則必須設定 currency

傳送事件

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

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
      }
    }]
  })
});

close_unconvert_lead

用來評估「使用者標示為未成為轉換後待開發客戶」這項事件, 以及原因。

參數

名稱 類型 必填 範例值 說明
currency string 是* 美元 活動 value 的幣別,採 3 個英文字母組成的 ISO 4217 格式。

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

* value 通常是產生有意義報表的必要條件。 如果將事件標示為重要事件,建議您設定 value
* 如已設定 value,則必須設定 currency
unconvert_lead_reason string 從未回覆 待開發客戶未轉換的原因。

傳送事件

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

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"
      }
    }]
  })
});

disqualify_lead

用來評估「使用者遭取消成為待開發客戶的資格」這項事件, 並提供取消資格的原因。

參數

名稱 類型 必填 範例值 說明
currency string 是* 美元 活動 value 的幣別,採 3 個英文字母組成的 ISO 4217 格式。

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

* value 通常是產生有意義報表的必要條件。 如果將事件標示為重要事件,建議您設定 value
* 如已設定 value,則必須設定 currency
disqualified_lead_reason string 不打算購買 待開發客戶遭標示為不符合資格的原因。

傳送事件

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

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"
      }
    }]
  })
});

earn_virtual_currency

用來評估「使用者在遊戲中獲得虛擬貨幣」這項事件。 請一併記錄這項事件和 spend_virtual_currency,進一步瞭解您的虛擬經濟。

參數

名稱 類型 必填 範例值 說明
virtual_currency_name string 寶石 虛擬貨幣的名稱。
value number 5 虛擬貨幣價值。

傳送事件

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

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 是* 美元 活動 value 的幣別,採 3 個英文字母組成的 ISO 4217 格式。

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

* value 通常是產生有意義報表的必要條件。 如果將事件標示為重要事件,建議您設定 value
* 如已設定 value,則必須設定 currency
lead_source string 商展 待開發客戶的來源。

傳送事件

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

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"
      }
    }]
  })
});

join_group

當使用者加入公會、團隊或家庭等群組時,請記錄這項事件。透過這個事件,分析特定群組或社交功能的熱門程度。

參數

名稱 類型 必填 範例值 說明
group_id string G_12345 群組的 ID。

傳送事件

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

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 升級的角色。

傳送事件

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

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"
      }
    }]
  })
});

login

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

參數

名稱 類型 必填 範例值 說明
method string Google 登入時使用的方法。

傳送事件

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

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 獲得分數的角色。

傳送事件

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

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 是* 美元 與事件相關聯的項目幣別,採用3 個字母的 ISO 4217 格式。

view_item 事件的價值指標不會計入收益

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

* 將 value 設為 (price * quantity) 中所有項目的總和,這些項目位於 items 中。請勿加入 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 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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 是* 美元 活動 value 的幣別,採 3 個英文字母組成的 ISO 4217 格式。

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

* value 通常是產生有意義報表的必要條件。 如果將事件標示為重要事件,建議您設定 value
* 如已設定 value,則必須設定 currency

傳送事件

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

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
      }
    }]
  })
});

refund

這個事件表示已退還一或多個項目給使用者。

參數

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

view_item 事件的價值指標不會計入收益

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

* 將 value 設為 (price * quantity) 中所有項目的總和,這些項目位於 items 中。請勿加入 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 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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 是* 美元 與事件相關聯的項目幣別,採用3 個字母的 ISO 4217 格式。

view_item 事件的價值指標不會計入收益

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

* 將 value 設為 (price * quantity) 中所有項目的總和,這些項目位於 items 中。請勿加入 shippingtax
* 通常需要 value 才能產生有意義的報表。 如果將事件標示為重要事件,建議您設定 value
* 如已設定 value,則必須設定 currency
items Array<Item> 活動項目。

項目參數

名稱 類型 必填 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*請提供 item_iditem_name 其中之一。

item_name string 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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 關於 畫面名稱。

傳送事件

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

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({
    "app_instance_id": "app_instance_id",
    "events": [{
      "name": "screen_view",
      "params": {
        "screen_class": "MainActivity",
        "screen_name": "About"
      }
    }]
  })
});

記錄這項事件,表示使用者已執行搜尋。您可以使用這項事件,找出使用者在網站或應用程式中搜尋的內容。舉例來說,使用者執行搜尋後,如果瀏覽搜尋結果網頁,您就可以傳送這項事件。

參數

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

傳送事件

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

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。

傳送事件

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

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 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

affiliation string Google 商店 產品關聯,用來指定供貨公司或實體商店位置。
注意:`affiliation` 僅適用於項目範圍。
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 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location 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 個自訂參數

傳送事件

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

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
          }
        ]
      }
    }]
  })
});

share

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

參數

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

傳送事件

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

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 註冊時使用的方法。

傳送事件

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

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 寶石 虛擬貨幣的名稱。
item_name string 新手加速 虛擬貨幣所用項目的名稱。

傳送事件

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

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,瞭解有多少使用者完成教學課程。

參數

系統未建議此事件使用任何參數。

這個事件沒有參數。

傳送事件

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

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,瞭解有多少使用者完成教學課程。

參數

系統未建議此事件使用任何參數。

傳送事件

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

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。

傳送事件

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

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 是* 美元 與事件相關聯的項目幣別,採用3 個字母的 ISO 4217 格式。

view_item 事件的價值指標不會計入收益

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

* 將 value 設為 (price * quantity) 中所有項目的總和,這些項目位於 items 中。請勿加入 shippingtax
* 通常需要 value 才能產生有意義的報表。 如果將事件標示為重要事件,建議您設定 value
* 如已設定 value,則必須設定 currency
items Array<Item> 活動項目。

項目參數

名稱 類型 必填 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*請提供 item_iditem_name 其中之一。

item_name string 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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 是* 美元 與事件相關聯的項目幣別,採用3 個字母的 ISO 4217 格式。

view_item 事件的價值指標不會計入收益

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

* 將 value 設為 (price * quantity) 中所有項目的總和,這些項目位於 items 中。請勿加入 shippingtax
* 通常需要 value 才能產生有意義的報表。 如果將事件標示為重要事件,建議您設定 value
* 如已設定 value,則必須設定 currency
items Array<Item> 活動項目。

項目參數

名稱 類型 必填 範例值 說明
item_id string 是* SKU_12345

商品的 ID。

*請提供 item_iditem_name 其中之一。

item_name string 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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

向使用者顯示特定類別的項目清單時,請記錄這項事件。

參數

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

view_item 事件的價值指標不會計入收益

* 如已設定 value,則還需要使用 currency 才能準確計算收益指標。
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 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

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

事件層級與項目層級的 coupon 參數各自獨立。
discount number 2.22 與項目相關聯的單位折扣金額。
index number 5 商品在清單中的索引/位置。
item_brand string Google 商品品牌。
item_category string 服飾 商品類別。如果做為類別階層或分類的一部分,這會是第一個類別。
item_category2 string 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location id` 僅適用於項目範圍。
price number 10.01 商品單價,以指定貨幣參數的單位表示。
如果商品適用折扣,請將 price 設為折扣後的單價,並在 discount 參數中指定單價折扣。
quantity number 3

商品數量。

如未設定,quantity 會設為 1。

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

傳送事件

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

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 是* Stan and Friends T 恤

商品名稱。

*請提供 item_iditem_name 其中之一。

affiliation string Google 商店 產品關聯,用來指定供貨公司或實體商店位置。
注意:`affiliation` 僅適用於項目範圍。
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 成人 商品的第二個類別階層或其他分類。
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 綠色 其他商品詳細資料/選項,如商品子類、專屬代碼或說明。
location_id string ChIJIQBpAG2ahYAR_6128GcTUEo (舊金山的 Google 地點 ID) 與商品相關聯的實體位置 (例如實體商店位置)。建議使用與相關聯項目對應的 Google 地點 ID。您也可以使用自訂位置 ID。
注意:`location 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 個自訂參數

傳送事件

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

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 服飾 搜尋時使用的字詞。

傳送事件

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

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 是* 美元 活動 value 的幣別,採 3 個英文字母組成的 ISO 4217 格式。

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

* value 通常是產生有意義報表的必要條件。 如果將事件標示為重要事件,建議您設定 value
* 如已設定 value,則必須設定 currency
lead_status string 已發起的對話 待開發客戶的狀態。

傳送事件

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

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"
      }
    }]
  })
});