GA4 イベントタグの「詳細設定」に「e コマースデータを送信」が実装されました。

セミナーアーカイブ

2022年の8月に、GA4のイベントタグの「詳細設定」に「『e コマース』 『e コマースデータを送信』」が実装されました。

GA4のイベントタグの「詳細設定」に「『e コマース』 『e コマースデータを送信』」が実装されました。

これまでは、GTMによるGA4のeコマースのイベント設定では、「変数」を設定し、それをカスタム イベントタグの「イベント パラメータ」に設定する必要がありました。今後は、Google推奨のeコマースの変数(後述)で適切なデータレイヤーの記述を行えば、「変数の設定」もカスタムイベントタグの「イベント パラメータ」の設定も不要になりました。

eコマースの「推奨イベント」

eコマースの「推奨イベント」は下記の通りです。

イベントこの記事に設定方法の解説がある?発火タイミング
add_payment_info支払い情報送信
add_shipping_info配送情報送信
add_to_cartYesカートに商品を追加
add_to_wishlist欲しい物リストに商品を追加
begin_checkoutYes購入手続きを開始
generate_lead問い合わせのためにフォームまたはリクエストを送信した時
purchaseYes購入完了
refundYes払い戻し実行
remove_from_cartYesカートから商品を削除
select_itemYesリストから商品を選択
select_promotionYesプロモーションを選択
view_cartカートを表示
view_itemYes商品詳細を表示
view_item_listYes商品一覧を表示
view_promotionYesプロモーションが表示された

ECに関わるイベントの流れの例

ECのイベントは上記すべてを計測する必要はありません。サイトの実情に合わせて、必要なものを組み合わせます。たとば、例として下記のような流れが考えられます。

上記の各イベントに「パラメータ」「itemパラメータ」が紐づきます。

GA4のデータは「イベント」と「パラメータ」で構成されていますが、eコマースのデータは「推奨イベント」「パラメータ」の他に商品情報を「itemパラメータ」(後述)で取得します。(2022年8月28日時点では「itemパラメータ」で取得したデータを「カスタム ディメンション」に登録できません。スコープ「商品」で「カスタム ディメンション」を設定することが出来ないためです。GA4のデフォルトで用意されているディメンションを使用する必要があります。)

eコマースの「パラメータ」

パラメータ名タイプ必須サンプルの値説明
currencystring○*JPYイベントに関連付けられた商品アイテムの通貨(3 文字の ISO 4217 形式)。
* 収益の指標が正確に計算されるように currency を指定する必要があります。
valuenumber○*10000金額合計。イベントの金銭的価値。
* 収益の指標が正確に計算されるように currency を指定する必要があります。
couponstringSummer01イベントに関連づけられたクーポンの名前。
payment_typestringCredit Card支払い方法
shipping_tierstringYamato購入された商品アイテムの配送方法
affiliationstringGoogle Store仕入れ先業者や実店舗を指定する商品アフィリエーション。
shippingstring700送料
transaction_idstringT_12345取引、注文ID
taxstring800税金
item_list_idstringw01商品が表示されたリストの ID
item_list_namestringWish_List商品が表示されたリストの名前
creative_namestringSummer_GIG_01プロモーションのクリエイティブの名前
creative_slotstringfeatured_app_1商品アイテムに関連付けられたプロモーション用のクリエイティブ スロットの名前。
location_idstringL_12345商品アイテムに関連付けられた場所。関連するアイテムに対応する Google プレイス ID を使用することをおすすめします。カスタムの地域 ID も使用できます。
promotion_idstringP_12345プロモーションの ID
promotion_namestringSummer Saleプロモーションの名前

eコマースの「itemパラメータ」


サンプルは、下記を参考にしました。
https://developers.google.com/tag-manager/ecommerce-ga4?hl=ja#measure_viewsimpressions_of_productitem_details

itemパラメータ名タイプ必須サンプルの値説明
item_idstring〇*SKU_12345商品アイテムの ID。
*item_id または item_name が必要です。
item_namestring〇*Stan and Friends Tee商品アイテムの名前。
*item_id または item_name が必要です。
pricenumber10000指定された通貨パラメータの単位で表した商品アイテムの価格。
quantitynumber1商品アイテムの数量
affiliationstringGoogle Store商品元や店舗を指定する商品アフィリエーション
couponstringSUMMER_FUN商品に関連したクーポン名
currencystringJPY通貨(3 文字の ISO 4217 形式)
discountnumber100商品に対する割引額
item_variantstringgreen商品アイテムのバリエーションまたは固有のコード、あるいはその他の詳細やオプションに関する説明
item_brandstringAmazon商品アイテムのブランド
item_categorystringApparel商品アイテムのカテゴリや分類
item_category2stringAdult商品アイテムのカテゴリや分類
item_category3stringShirts商品アイテムのカテゴリや分類
item_category4stringCrew商品アイテムのカテゴリや分類
item_category5stringShort sleeve商品アイテムのカテゴリや分類
indexnumber3リスト内の商品アイテムのインデックスまたは位置
item_list_idstringrelated_productsユーザーに商品アイテムが表示されたリストの ID。
item_list_namestringRelated productsユーザーに商品アイテムが表示されたリストの名前。
location_idstringL_12345商品アイテムに関連付けられた場所。関連するアイテムに対応する
Google プレイス ID を使用するか、カスタムの地域 ID も使用できます。
promotion_idstringP_12345商品アイテムに関連付けられたプロモーションの ID。
promotion_namestringSummer Sale商品アイテムに関連付けられたプロモーションの名前。

Google推奨のeコマースの変数については、こちらをご参照ください。
e コマース(GA4)デベロッパー ガイド
https://developers.google.com/tag-manager/ecommerce-ga4?hl=ja

1. view_item GTMイベント設定

まずは、view_itemについて、見てみます。

変数とパラメータの設定が必要だった時は、view_itemのイベントタグの設定は上記にようになっていました。

現在の設定方法では、Google推奨のeコマースの変数を使っていれば、変数の設定が不要となります。また、イベントタグに「イベント パラメータ」を記述する必要もありません。「e コマースデータを送信」にチェックを入れて、データソースは「Data Layer」を選択します。

イベント view_item のトリガー

トリガーのタイプは、「カスタム イベント」を使用しています。

view_itemのデータレイヤーのサンプルは下記の通りです。

データレイヤーに適切な値が出力されるようにするには、システム開発が必要です。

<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
dataLayer.push({ event: "view_item", 
ecommerce: {
  items: [{
    item_name: "Donut Friday Scented ", 		
    item_id: "ii20220829_0933", 
    price: 10000,
    item_brand: "Google",
    item_category: "Apparel",
    item_category2: "Mens",
    item_category3: "Shirts",
    item_category4: "Tshirts",
    item_variant: "Black",
    item_list_name: "Search Results",
    item_list_id: "SR123",
    index: 1,
    quantity: 1
  }]
} }); 
</script>

レポート > ライフサイクル > 収益化 > eコマース購入数
にて、翌日以降データを確認すると、
view_itemイベントで、「アイテム名」「アイテム ID」「アイテムのカテゴリ」「アイテムのカテゴリ 2~5」「アイテムのブランド」が計測できていることが確認できます。

2. purchase GTMイベント設定

変数とパラメータの設定が必要だった時は、purchaseのイベントタグの設定は上記にようになっていました。

(繰り返しになりますが、)現在の設定方法では、Google推奨のeコマースの変数を使っていれば、変数の設定が不要となります。また、イベントタグに「イベント パラメータ」を記述する必要もありません。「e コマースデータを送信」にチェックを入れて、データソースは「Data Layer」を選択します。

イベント purchase のトリガー

トリガーのタイプは、「カスタム イベント」を使用しています。

purchaseのデータレイヤーのサンプルは下記の通りです。

<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
dataLayer.push({event: "purchase",
  ecommerce: {
    transaction_id: "T20220829_0933", 
    affiliation: "Online Store",
    value: "20000",
    tax: "1600",
    shipping: "1000",
    currency: "JPY",
    coupon: "SUMMER_SALE",
    items: [{
      item_name: "Donut Friday Scented T-Shirt", 
      item_id: "ii20220829_0933", 
      price: 10000,
      item_brand: "Google",
      item_category: "Apparel",
      item_variant: "Black",
      quantity: 1
    }, {
      item_name: "Donut Friday Scented T-Shirt",
      item_id: "ii20220829_0933_2",
      price: 10000, item_brand: "Amazon",
      item_category: "Apparel",
      item_variant: "Red",
      quantity: 1
    }]
  }
});
</script>

3. view_promotion GTMイベント設定

変数とパラメータの設定が必要だった時は、view_promotionのイベントタグの設定は上記にようになっていました。

(繰り返しになりますが、)現在の設定方法では、Google推奨のeコマースの変数を使っていれば、変数の設定が不要となります。また、イベントタグに「イベント パラメータ」を記述する必要もありません。「e コマースデータを送信」にチェックを入れて、データソースは「Data Layer」を選択します。

イベント view_promotion のトリガー

トリガーのタイプは、「カスタム イベント」を使用しています。

view_promotionのデータレイヤーのサンプルは下記の通りです。

<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "view_promotion",
  ecommerce: {
    items: [{
      item_name: "Donut Friday Scented T-Shirt",
      item_id: "ii20220829_0933",
      price: 10000,
      item_brand: "Google",
      item_category: "Apparel",
      item_category2: "Mens",
      item_category3: "Shirts",
      item_category4: "Tshirts",
      item_variant: "Black",
      promotion_id: "abc123",
      promotion_name: "summer_promo",
      creative_name: "instore_suummer",
      creative_slot: "1",
      location_id: "hero_banner",
      index: 1,
      quantity: 1
    }]
  }
});
</script>

4. select_promotion GTMイベント設定

変数とパラメータの設定が必要だった時は、select_promotionのイベントタグの設定は上記にようになっていました。

(繰り返しになりますが、)現在の設定方法では、Google推奨のeコマースの変数を使っていれば、変数の設定が不要となります。また、イベントタグに「イベント パラメータ」を記述する必要もありません。「e コマースデータを送信」にチェックを入れて、データソースは「Data Layer」を選択します。

イベント select_promotion のトリガー

トリガーは「クリック – リンクのみ」を使用しています。
トリガーの「Click Classess 等しい Select_Promotion」の「Select_Promotion」は、下記のselect_promotionのHTMLのソースのサンプルに記述してあります。

「select_promotion」のHTMLのソースのサンプルは下記の通りです。view_promotion.pngというボタンがクリックされると、必要なデータレイヤーが生成されるようになっています。下記の例はあくまでもサンプルで、記述方法は、ウェブサイトの実装担当の方にご相談ください。

<html lang="ja">
<head>

<script>
function onPromotionClick() {

  var dataset = JSON.parse(JSON.stringify(this.dataset));
  var item = Object.getOwnPropertyNames(dataset).reduce(function(prev, current) {
    var key = current.replace(/[A-Z]/g, function(char){ return '_' + char.toLowerCase();});
    prev[key] = /price|index|quantity/.test(key) ? Number(dataset[current]) : dataset[current];
    return prev
  }, {});

  dataLayer.push({ ecommerce: null });
  dataLayer.push({
    event: "select_promotion",
    ecommerce: {
      items: [ item ]
    }
  });
}
</script>

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WKLP4D3');</script>
<!-- End Google Tag Manager -->

<meta charset="utf-8" />
<link rel="stylesheet" href="css/general.css"/>
<title>EC_select_promotion | EC_test</title>
</head>

<body>

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WKLP4D3"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->	

<h1>ECテスト select_promotion</h1>

<p>
<a class="Select_Promotion" href="view_item_list.html"
  data-item-name="Donut Friday Scented T-Shirt"
  data-item-id="ii20220829_0933"
  data-price=10000
  data-item_brand: "Google",
  data-item_category: "Apparel",
  data-item_category2: "Mens",
  data-item_category3: "Shirts",
  data-item_category4: "Tshirts",
  data-item_variant: "Black",
  data-promotion_id: "abc123",
  data-promotion_name: "summer_promo",
  data-creative_name: "instore_suummer",
  data-creative_slot: "1",
  data-index="1"
  data-quantity="1"
  onclick="onPromotionClick()"
><img src="images/view_promotion.png"></a>
</p>

</body>
</html>

5. view_item_list GTMイベント設定

変数とパラメータの設定が必要だった時は、view_item_listのイベントタグの設定は上記にようになっていました。

(繰り返しになりますが、)現在の設定方法では、Google推奨のeコマースの変数を使っていれば、変数の設定が不要となります。また、イベントタグに「イベント パラメータ」を記述する必要もありません。「e コマースデータを送信」にチェックを入れて、データソースは「Data Layer」を選択します。

イベント view_item_list のトリガー

トリガーのタイプは、「カスタム イベント」を使用しています。

view_item_listのデータレイヤーのサンプルは下記の通りです。

<script>
window.dataLayer = window.dataLayer || [];
// Measure product views / impressions
dataLayer.push({ ecommerce: null });  // Clear the previous ecommerce object.
dataLayer.push({
  event: "view_item_list",
  ecommerce: {
    items: [
    {
      item_name: "Donut Friday Scented T-Shirt",
      item_id: "ii20220829_0933",
      price: 10000,
      item_brand: "Google",
      item_category: "Apparel",
      item_category2: "Mens",
      item_category3: "Shirts",
      item_category4: "Tshirts",
      item_variant: "Black",
      item_list_name: "Search Results",
      item_list_id: "SR123",
      index: 1,
      quantity: 1
    },
    {
      item_name: "Donut Friday Scented T-Shirt_2",
      item_id: "ii20220829_0933_2",
      price: 10000,
      item_brand: "Amazon",
      item_category: "Apparel_2",
      item_category2: "Mens_2",
      item_category3: "Shirts_2",
      item_category4: "Tshirts_2",
      item_variant: "Red",
      item_list_name: "Search Results_2",
      item_list_id: "SR123_2",
      index: 2,
      quantity: 1
    }]
  }
});
</script>

6. select_item GTMイベント設定

変数とパラメータの設定が必要だった時は、select_itemのイベントタグの設定は上記にようになっていました。

(繰り返しになりますが、)現在の設定方法では、Google推奨のeコマースの変数を使っていれば、変数の設定が不要となります。また、イベントタグに「イベント パラメータ」を記述する必要もありません。「e コマースデータを送信」にチェックを入れて、データソースは「Data Layer」を選択します。

イベント select_item のトリガー

トリガーは「クリック – リンクのみ」を使用しています。
トリガーの「Click Classess 等しい productdetails」の「Select_Promotion」は、下記のselect_itemのHTMLのソースのサンプルに記述してあります。

「select_item」のHTMLのソースのサンプルは下記の通りです。「Donut Friday Scanted T-Shirt」というリンクがクリックされると、必要なデータレイヤーが生成されるようになっています。下記の例はあくまでもサンプルで、記述方法は、ウェブサイトの実装担当の方にご相談ください。

<html lang="ja" >
<head>


<script>
function onProductClick() {

  var dataset = JSON.parse(JSON.stringify(this.dataset));
  var item = Object.getOwnPropertyNames(dataset).reduce(function(prev, current) {
    var key = current.replace(/[A-Z]/g, function(char){ return '_' + char.toLowerCase();});
    prev[key] = /price|index|quantity/.test(key) ? Number(dataset[current]) : dataset[current];
    return prev
  }, {});
  window.dataLayer = window.dataLayer || [];
  dataLayer.push({ ecommerce: null });
  dataLayer.push({
    event: "select_item",
    ecommerce: {
      items: [ item ]
    }
  });
}
</script>

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WKLP4D3');</script>
<!-- End Google Tag Manager -->

<meta charset="utf-8" />
<link rel="stylesheet" href="css/general.css"/>
<title>EC_select_item | EC_test</title>
</head>

<body>

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WKLP4D3"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->	

<h1>ECテスト select_item</h1>

<p>
<a class="productdetails" href="items/productdetails.html"
  data-item-name="Donut Friday Scented T-Shirt"
  data-item-id="ii20220829_0933"
  data-price="10000"
  data-item-brand="Google"
  data-item-category="Apparel"
  data-item-category2="Mens"
  data-item-category3="Shirts"
  data-item-category4="Tshirts"
  data-variant="Black"
  data-item-list-name="Search Results"
  data-item-list-id="SR123"
  data-index="1"
  data-quantity="1"
  onclick="onProductClick()"
>Donut Friday Scanted T-Shirt</a>
</p>

</body>
</html>

7. add_to_cart GTMイベント設定

変数とパラメータの設定が必要だった時は、add_to_cartのイベントタグの設定は上記にようになっていました。

(繰り返しになりますが、)現在の設定方法では、Google推奨のeコマースの変数を使っていれば、変数の設定が不要となります。また、イベントタグに「イベント パラメータ」を記述する必要もありません。「e コマースデータを送信」にチェックを入れて、データソースは「Data Layer」を選択します。

イベント select_item のトリガー

トリガーは「クリック – リンクのみ」を使用しています。
トリガーの「Click Classess 等しい add_to_cart」の「add_to_cart」は、下記のadd_to_cartのHTMLのソースのサンプルに記述してあります。

「add_to_cart」のHTMLのソースのサンプルは下記の通りです。

<a class="add_to_cart" href="cart/cart.html"><strong>Donut Friday Scented T-Shirt</strong>をカートに入れる</a>

という記述内の、「class=”add_to_cart”」の部分をトリガーが見ています。

下記の例はあくまでもサンプルで、記述方法は、ウェブサイトの実装担当の方にご相談ください。

<html lang="ja" >
<head>

<script>
window.dataLayer = window.dataLayer || [];
// Measure when a product is added to a shopping cart
dataLayer.push({ ecommerce: null });  // Clear the previous ecommerce object.
dataLayer.push({
  event: "add_to_cart",
  ecommerce: {
    items: [{
      item_name: "Donut Friday Scented T-Shirt",
      item_id: "ii20220829_0933",
      price: 10000,
      item_brand: "Google",
      item_category: "Apparel",
      item_category2: "Mens",
      item_category3: "Shirts",
      item_category4: "Tshirts",
      item_variant: "Black",
      item_list_name: "Search Results",
      item_list_id: "SR123",
      index: 1,
      quantity: 1
    }]
  }
});
</script>

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WKLP4D3');</script>
<!-- End Google Tag Manager -->

<meta charset="utf-8" />
<link rel="stylesheet" href="css/general.css"/>
<title>EC_add_to_cart | EC_test</title>
</head>

<body>

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WKLP4D3"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->	

<h1>ECテスト add_to_cart</h1>

<p>
<a class="add_to_cart" href="cart/cart.html"><strong>Donut Friday Scented T-Shirt</strong>をカートに入れる</a>
</p>

</body>
</html>

8. remove_from_cart GTMイベント設定

変数とパラメータの設定が必要だった時は、add_to_cartのイベントタグの設定は上記にようになっていました。

(繰り返しになりますが、)現在の設定方法では、Google推奨のeコマースの変数を使っていれば、変数の設定が不要となります。また、イベントタグに「イベント パラメータ」を記述する必要もありません。「e コマースデータを送信」にチェックを入れて、データソースは「Data Layer」を選択します。

イベント remove_from_cart のトリガー

トリガーは「クリック – リンクのみ」を使用しています。
トリガーの「Click Classess 等しい remove_from_cart」の「remove_from_cart」は、下記のremove_from_cartのHTMLのソースのサンプルに記述してあります。

「remove_from_cart」のdataLayerのサンプルは下記の通りです。

<script>
window.dataLayer = window.dataLayer || [];
// Measure the removal of a product from a shopping cart.
dataLayer.push({ ecommerce: null }); 
dataLayer.push({
  event: "remove_from_cart",
  ecommerce: {
    items: [{
      item_name: "Donut Friday Scented T-Shirt 20220829_0933",
      item_id: "ii20220829_0933",
      price: 10000,
      item_brand: "Google",
       item_category: "Apparel",
       item_category2: "Mens",
       item_category3: "Shirts",
       item_category4: "Tshirts",
       item_variant: "Black",
       item_list_name: "Search Results",
       item_list_id: "SR123",
      index: 1,
      quantity: 1
    }]
  }
});
</script>

9. begin_checkout GTMイベント設定

変数とパラメータの設定が必要だった時は、begin_checkoutのイベントタグの設定は上記にようになっていました。

(繰り返しになりますが、)現在の設定方法では、Google推奨のeコマースの変数を使っていれば、変数の設定が不要となります。また、イベントタグに「イベント パラメータ」を記述する必要もありません。「e コマースデータを送信」にチェックを入れて、データソースは「Data Layer」を選択します。

イベント begin_chekout のトリガー

トリガーは「クリック – リンクのみ」を使用しています。
トリガーの「Click Classess 含む begin_checkout」の「begin_checkout」は、下記のbegin_checkoutのHTMLのソースのサンプルに記述してあります。

「begin_checkout」のdataLayerのサンプルは下記の通りです。

<html lang="ja" >
<head>

<script>
function onCheckout() {
  window.dataLayer = window.dataLayer || [];
  dataLayer.push({ ecommerce: null });  // Clear the previous ecommerce object.
  dataLayer.push({
    event: "begin_checkout",
    ecommerce: {
      items: [{
        item_name: "Donut Friday Scented T-Shirt",
        item_id: "ii20220829_0933",
        price: 10000,
        item_brand: "Google",
        item_category: "Apparel",
        item_category2: "Mens",
        item_category3: "Shirts",
        item_category4: "Tshirts",
        item_variant: "Black",
        item_list_name: "Search Results",
        item_list_id: "SR123",
        index: 1,
        quantity: 1
      }]
    }
  });
}
</script>

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WKLP4D3');</script>
<!-- End Google Tag Manager -->

<meta charset="utf-8" />
<link rel="stylesheet" href="css/general.css"/>
<title>EC_begin_checkout | EC_test</title>
</head>

<body>

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WKLP4D3"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->	

<h1>ECテスト begin_checkout</h1>


<p>
<a class="begin_checkout" onclick="onCheckout()" href="purchase.html">チェックアウトプロセスを開始する。</a>
</p>

</body>
</html>

10. refund GTMイベント設定

変数とパラメータの設定が必要だった時は、refundのイベントタグの設定は上記にようになっていました。

(繰り返しになりますが、)現在の設定方法では、Google推奨のeコマースの変数を使っていれば、変数の設定が不要となります。また、イベントタグに「イベント パラメータ」を記述する必要もありません。「e コマースデータを送信」にチェックを入れて、データソースは「Data Layer」を選択します。

イベント refund のトリガー

トリガーは「カスタム イベント」を使用します。

「refund」のdataLayerのサンプルは下記の通りです。

<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "refund",
  ecommerce: {
      transaction_id: "20220830-1350", // Transaction ID.
      items: [{
        item_name: "Donut Friday Scented T-Shirt",
        item_id: "ii20220829_0933",
        price: 10000,
        item_brand: "Google",
        item_category: "Apparel",
        item_category2: "Mens",
        item_category3: "Shirts",
        item_category4: "Tshirts",
        item_variant: "Black",
        item_list_name: "Search",
        item_list_id: "SR123",
        index: 1,
        quantity: 1
      }]
  }
});
</script>

関連記事

特集記事

コメント

  1. Goodd post. I leatn something totally neew and challenging oon sitres I stumbleupon on a aily basis.
    It’s alwayus useful too rread through atticles from other wriuters and prqctice
    a little something fom tbeir webb sites.

  2. With havin so muh ccontent annd articles ddo yyou ecer run into any issues
    oof plagorsm or copyright violation? My site has a llot of uniue contenmt
    I’ve either create myself oor oufsourced butt it looks like a loot oof iit iss popping iit
    up all over the wweb without my authorization. Do you know any methods
    too help prevent content frfom being stolen? I’d genuiinely appreciate
    it.

  3. I’m impressed, I hhave to admit. Seldom do I encouunter a
    blo that’s both eaually educative and amusing, and withouyt a doubt, you’ve hiit tthe nasil onn the head.
    The problem is ann issue thhat not enough men andd women aree speaking
    intelligently about. I’m very happy that I came across this
    in my hunt for something relating to this.

  4. I’m extremely inspred togethdr with yor writing
    abilities as neatoy as wkth the layout to yohr weblog.
    Is this a paid ubject mattter or didd you
    modify it yor self? Anyway keep up the nice hig quality writing, it iis rre to peer a nice blog lie this one today..

  5. I’m not sure whhere you’re geting your information, but great topic.
    I needs to spend some time learning much more or understanding more.
    Thanks for wondetful innformation I was looking for thiks information foor my mission.

ランキング(週間)

  1. 1

    GA4の指標「総ユーザー数」VS「アクティブ ユーザー数」

  2. 2

    GA4の探索で「ページ別訪問数」を見ることは可能か?

  3. 3

    GA4 「ページ ロケーション」と「ページ パス と スクリーン クラス」何が違う?ドメインの有無以外にもパラメータの扱いに違いあり

  4. 4

    GA4 拡張計測機能の新顔「フォームの操作」 form_start, form_submit

  5. 5

    GA4 クロスドメイン設定では、リンク先に「_gl」パラメータが付く。勝手なパラメータを付けるとエラーになるページは要注意

  6. 6

    GA4で異なるドメイン(サブドメイン)の同一ページパスをドメイン付きで表示する

  7. 7

    GA4のレポート画面の数値データは、イベント発生時から何時間後に確定するのか?

  8. 8

    【祝・GPT-4 が ChatGPT plus に登場記念!】アクセス解析コンサルタントが、GPT-4にCSVデータを渡して、データ解析結果のコメントを書いてもらう方法

  9. 9

    ユニバーサル アナリティクス終了 過去データはどうなる?

  10. 10

    GA4の導入 「Google タグ」編

最近の記事

  1. ECサイトのゴールデンルートを発見する方法 – Google Analytics 4とPythonを活用して(第2回)

  2. GA4 -> トレジャーデータ 連携術

  3. ECサイトのゴールデンルートを発見する方法 – Google Analytics 4とPythonを活用して(第1回)

カテゴリー

 
TOP