전자상거래 이벤트를 설정하여 사용자의 쇼핑 행동에 대한 정보를 수집할 수 있습니다. 이벤트를 통해 가장 인기 있는 제품을 수량화하고 프로모션 및 제품 게재위치가 수익에 미치는 영향을 확인할 수 있습니다.
이 문서에서는 각 전자상거래 이벤트와 이벤트 설정 시점을 설명합니다. 전자상거래 이벤트를 설정하는 방법의 단계별 예는 구매 이벤트 설정을 참고하세요.
시작하기 전에
웹사이트에 GA4 구성 태그 추가
웹사이트에 Google 애널리틱스: GA4 구성 태그를 추가하고 애널리틱스 및 웹사이트 소스 코드에 액세스할 수 있도록 하세요.
GA4 이벤트 태그로 전자상거래 이벤트 측정
Google 애널리틱스 속성에 전자상거래 이벤트 및 매개변수를 전송하려면 다음 단계를 따르세요.
Google 태그 관리자를 엽니다.
작업공간에서 태그 메뉴를 엽니다.
새 태그를 만듭니다. 태그 구성 상자를 클릭하고 Google 애널리틱스: GA4 이벤트 태그를 선택합니다.
이벤트 이름에 기본 제공 변수
{{Event}}를 사용합니다. 이렇게 하면 gtag.js API를 사용하여 전송된 Google 애널리틱스 전자상거래 이벤트 이름이 사용됩니다.설정 더보기 > 전자상거래에서 전자상거래 데이터 전송을 선택합니다.
데이터 소스에서 데이터 영역을 선택합니다.

GA4 이벤트(예: 사용자가 결제 버튼을 클릭하는 경우)의 트리거를 설정합니다. 사용 가능한 모든 트리거 유형 보기
태그의 이름을 지정하고 저장합니다.
권장사항
- 디버그 모드를 사용 설정하여 실시간으로 이벤트를 확인하고 문제를 해결하세요.
- 전자상거래 이벤트와 함께 맞춤 매개변수를 전송할 때 맞춤 측정기준 및 측정항목 한도를 검토하세요.
- 수익 측정항목을 올바르게 계산할 수 있도록
value(수익) 데이터를 전송할 때currency를 설정하세요. - 매개변수가 선택사항인지 여부와 관계없이 데이터가 있는 각 전자상거래 매개변수를 설정하세요.
- 샘플 전자상거래 웹사이트를 사용하여 웹사이트에 태그를 추가하는 방법의 예시를 확인하세요.
- 보고서에 데이터가 올바르게 채워지도록 하려면 이 문서의 형식을 따르세요. 전자상거래 배열 외부에서 상품 배열을 설정해야 하는 경우
value(수익) 데이터를 전송할 때 이벤트 수준에서currency매개변수를 설정합니다.
구현
일반적인 전자상거래 구현은 다음 작업 중 하나를 측정합니다.
이러한 작업의 핵심은 판매하는 제품 및 서비스입니다. 전자상거래 이벤트에 추가할 수 있는 항목의 배열로 제품과 서비스를 나타낼 수 있습니다. 사전 정의된 매개변수 외에도 최대 27개의 맞춤 매개변수를 항목 배열에 포함할 수 있습니다.
다음 예시는 이 가이드에서 언급하는 items 컬렉션을 만드는 방법을 보여줍니다. items 배열에는 최대 200개의 요소가 포함될 수 있습니다.
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
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
},
{
item_id: "SKU_12346",
item_name: "Google Grey Women's Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
discount: 3.33,
index: 1,
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: "gray",
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 21.01,
quantity: 2
}
]
목록에서 항목 선택
사용자에게 결과 목록이 표시되면 표시된 항목을 포함하는 items 배열 매개변수를 비롯한 view_item_list 이벤트를 전송합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
view_item_list - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 상품 목록 ID -
ecommerce.item_list_id - 전자상거래 상품 목록 이름 -
ecommerce.item_list_name - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}item_list_id-{{Ecommerce Item List ID}}item_list_name-{{Ecommerce Item List Name}}- 트리거: 이벤트가
view_item_list와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
view_item_list - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "view_item_list",
ecommerce: {
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",
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.03,
quantity: 3
},
{
item_id: "SKU_12346",
item_name: "Google Grey Women's Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
discount: 3.33,
index: 1,
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: "gray",
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 21.01,
promotion_id: "P_12345",
promotion_name: "Summer Sale",
quantity: 2
}]
}
});
사용자가 목록에서 항목을 선택하면 items 배열 매개변수에서 선택한 항목과 함께 select_item 이벤트를 전송합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
select_item - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 상품 목록 ID -
ecommerce.item_list_id - 전자상거래 상품 목록 이름 -
ecommerce.item_list_name - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}item_list_id-{{Ecommerce Item List ID}}item_list_name-{{Ecommerce Item List Name}}- 트리거: 이벤트가
select_item와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
select_item - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "select_item",
ecommerce: {
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",
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 이벤트를 전송합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
view_item - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 가격 -
ecommerce.value - 전자상거래 통화 -
ecommerce.currency - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}value-{{Ecommerce Value}}currency-{{Ecommerce Currency}}- 트리거: 이벤트가
view_item와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
view_item - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "view_item",
ecommerce: {
currency: "USD",
value: 30.03,
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
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
}
]
}
});
장바구니에서 항목 추가 또는 삭제
items 배열에서 관련성 높은 항목이 포함된 add_to_cart 이벤트를 전송하여 장바구니에 추가되는 항목을 측정합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
add_to_cart - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 가격 -
ecommerce.value - 전자상거래 통화 -
ecommerce.currency - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}value-{{Ecommerce Value}}currency-{{Ecommerce Currency}}- 트리거: 이벤트가
add_to_cart와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
add_to_cart - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "add_to_cart",
ecommerce: {
currency: "USD",
value: 30.03,
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
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
}
]
}
});
items 배열에 있는 관련 항목이 포함된 add_to_wishlist 이벤트를 전송하여 항목이 위시리스트에 추가된 시점을 측정할 수도 있습니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
add_to_wishlist - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 가격 -
ecommerce.value - 전자상거래 통화 -
ecommerce.currency - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}value-{{Ecommerce Value}}currency-{{Ecommerce Currency}}- 트리거: 이벤트가
add_to_wishlist와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
add_to_wishlist - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "add_to_wishlist",
ecommerce: {
currency: "USD",
value: 30.03,
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
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_cart 이벤트를 장바구니에 있는 모든 항목과 함께 전송합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
view_cart - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 가격 -
ecommerce.value - 전자상거래 통화 -
ecommerce.currency - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}value-{{Ecommerce Value}}currency-{{Ecommerce Currency}}- 트리거: 이벤트가
view_cart와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
view_cart - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "view_cart",
ecommerce: {
currency: "USD",
value: 30.03,
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
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 이벤트를 전송합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
remove_from_cart - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 가격 -
ecommerce.value - 전자상거래 통화 -
ecommerce.currency - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}value-{{Ecommerce Value}}currency-{{Ecommerce Currency}}- 트리거: 이벤트가
remove_from_cart와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
remove_from_cart - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "remove_from_cart",
ecommerce: {
currency: "USD",
value: 30.03,
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
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 이벤트를 전송하여 결제 프로세스의 첫 번째 단계를 측정합니다. 쿠폰을 이벤트에 추가하여 이 단계에서 전체 주문에 추가하거나, items 배열의 특정 요소에 추가하여 특정 상품에 적용할 수 있습니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
begin_checkout - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 가격 -
ecommerce.value - 전자상거래 통화 -
ecommerce.currency - 전자상거래 쿠폰 -
ecommerce.coupon - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}value-{{Ecommerce Value}}currency-{{Ecommerce Currency}}coupon-{{Ecommerce Coupon}}- 트리거: 이벤트가
begin_checkout와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
begin_checkout - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "begin_checkout",
ecommerce: {
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",
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 이벤트를 전송합니다. shipping_tier 매개변수를 사용하여 사용자의 배송 옵션(예: '지상', '항공' 또는 '익일')을 지정합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
add_shipping_info - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 가격 -
ecommerce.value - 전자상거래 통화 -
ecommerce.currency - 전자상거래 쿠폰 -
ecommerce.coupon - 전자상거래 배송 등급 -
ecommerce.shipping_tier - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}value-{{Ecommerce Value}}currency-{{Ecommerce Currency}}coupon-{{Ecommerce Coupon}}shipping_tier-{{Ecommerce Shipping Tier}}- 트리거: 이벤트가
add_shipping_info와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
add_shipping_info - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "add_shipping_info",
ecommerce: {
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",
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_payment_info 이벤트를 전송합니다.
해당하는 경우 선택한 결제 수단에 대해 이 이벤트에 payment_type을 추가합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
add_payment_info - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 가격 -
ecommerce.value - 전자상거래 통화 -
ecommerce.currency - 전자상거래 쿠폰 -
ecommerce.coupon - 전자상거래 결제 방식 -
ecommerce.payment_type - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}value-{{Ecommerce Value}}currency-{{Ecommerce Currency}}coupon-{{Ecommerce Coupon}}payment_type-{{Ecommerce Payment Type}}- 트리거: 이벤트가
add_payment_info와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
add_payment_info - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "add_payment_info",
ecommerce: {
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",
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
}
]
}
});
구매 또는 환불 처리
관련성 높은 필드로 정의된 하나 이상의 항목과 함께 purchase 이벤트를 전송하여 구매를 측정합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
purchase - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 거래 ID -
ecommerce.transaction_id - 전자상거래 가격 -
ecommerce.value - 전자상거래 세금 -
ecommerce.tax - 전자상거래 배송 -
ecommerce.shipping - 전자상거래 통화 -
ecommerce.currency - 전자상거래 쿠폰 -
ecommerce.coupon - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}transaction_id-{{Ecommerce Transaction ID}}value-{{Ecommerce Value}}tax-{{Ecommerce Tax}}shipping-{{Ecommerce Shipping}}currency-{{Ecommerce Currency}}coupon-{{Ecommerce Coupon}}- 트리거: 이벤트가
purchase와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
purchase - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "T_12345",
// Sum of (price * quantity) for all items.
value: 72.05,
tax: 3.60,
shipping: 5.99,
currency: "USD",
coupon: "SUMMER_SALE",
customer_type: "new",
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
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
},
{
item_id: "SKU_12346",
item_name: "Google Grey Women's Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
discount: 3.33,
index: 1,
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: "gray",
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 21.01,
promotion_id: "P_12345",
promotion_name: "Summer Sale",
quantity: 2
}]
}
});
관련 transaction_id가 지정된 refund 이벤트의 경우 item_id 및 quantity로 정의된 하나 이상의 항목을 전송하여 환불을 측정합니다. refund참고: 애널리틱스에서 상품 수준의 환불 측정항목을 확인하려면 이벤트에 상품 정보를 포함하는 것이 좋습니다.
전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
refund - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 상품 -
ecommerce.items - 전자상거래 거래 ID -
ecommerce.transaction_id - 전자상거래 가격 -
ecommerce.value - 전자상거래 세금 -
ecommerce.tax - 전자상거래 배송 -
ecommerce.shipping - 전자상거래 통화 -
ecommerce.currency - 전자상거래 쿠폰 -
ecommerce.coupon - 이벤트 매개변수(매개변수 이름 - 값):
items-{{Ecommerce Items}}transaction_id-{{Ecommerce Transaction ID}}value-{{Ecommerce Value}}tax-{{Ecommerce Tax}}shipping-{{Ecommerce Shipping}}currency-{{Ecommerce Currency}}coupon-{{Ecommerce Coupon}}- 트리거: 이벤트가
refund와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
refund - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "refund",
ecommerce: {
currency: "USD",
transaction_id: "T_12345", // Transaction ID. Required for purchases and refunds.
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",
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 이벤트를 전송하여 초기 화면 조회수를 통해 측정합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 이벤트 이름:
view_promotion - 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 광고 소재 이름 -
ecommerce.creative_name - 전자상거래 광고 소재 슬롯 -
ecommerce.creative_slot - 전자상거래 프로모션 ID -
ecommerce.promotion_id - 전자상거래 프로모션 이름 -
ecommerce.promotion_name - 전자상거래 상품 -
ecommerce.items - 이벤트 매개변수(매개변수 이름 - 값):
creative_name-{{Ecommerce Creative Name}}creative_slot-{{Ecommerce Creative Slot}}promotion_id-{{Ecommerce Promotion ID}}promotion_name-{{Ecommerce Promotion Name}}items-{{Ecommerce Items}}- 트리거: 이벤트가
view_promotion와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
view_promotion - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "view_promotion",
ecommerce: {
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",
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 이벤트를 전송합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
태그 구성 보기
태그 구성:
- 태그 유형: Google 애널리틱스: GA4 이벤트
- 데이터 영역 변수(이름 - 데이터 영역 변수 이름):
- 전자상거래 광고 소재 이름 -
ecommerce.creative_name - 전자상거래 광고 소재 슬롯 -
ecommerce.creative_slot - 전자상거래 프로모션 ID -
ecommerce.promotion_id - 전자상거래 프로모션 이름 -
ecommerce.promotion_name - 전자상거래 상품 -
ecommerce.items - 이벤트 매개변수(매개변수 이름 - 값):
creative_name-{{Ecommerce Creative Name}}creative_slot-{{Ecommerce Creative Slot}}promotion_id-{{Ecommerce Promotion ID}}promotion_name-{{Ecommerce Promotion Name}}items-{{Ecommerce Items}}- 변수 유형: 데이터 영역 변수 - 'ecommerce.items'
- 트리거: 이벤트가
select_promotion와 일치
트리거는 다음과 같이 구성되어 있습니다.
- 트리거 유형: 맞춤 이벤트
- 이벤트 이름:
select_promotion - 트리거 실행 조건: 모든 맞춤 이벤트
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "select_promotion",
ecommerce: {
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",
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
}
]
}
});
맞춤 자바스크립트 변수 사용
웹사이트에서 데이터 영역을 지원하지 않는 경우, 맞춤 자바스크립트 변수를 사용하여 전자상거래 데이터 객체를 반환하는 함수를 호출할 수 있습니다. 이 객체는 이 가이드의 앞부분에 제시된 데이터 영역 구문을 사용해야 하며, 예를 들면 다음과 같습니다.
// A Custom JavaScript Variable that returns an ecommerceData object
// that follows the data layer syntax.
function getEcommerceData() {
var ecommerceProductData = [
{
item_name: "Stan and Friends Tee",
item_id: "SKU_12345", // ID is required.
// Rest of the product data should follow the data layer syntax.
},
// Multiple products may be included.
];
return ecommerceProductData;
}
맞춤 JavaScript 변수를 사용하는 경우, 데이터 영역과 동일한 방식으로 사용할 수 있습니다. 즉, items 매개변수의 값을 태그 구성의 이벤트 매개변수로 제공할 수 있습니다.
태그 구성:
- 태그 유형: GA4 이벤트
- 이벤트 이름: 임의
- 변수에서 데이터 읽기:
{{gaEcommerceData}} - 트리거: 이벤트가
gtm.dom와 일치
{{gaEcommerceData}} 변수 설정:
- 변수 유형: 맞춤 자바스크립트
- 함수 본문: 위의 예시 사용