전자상거래 이벤트를 설정하여 사용자의 쇼핑 행동에 대한 정보를 수집할 수 있습니다. 이벤트를 통해 가장 인기 있는 제품을 수량화하고 프로모션 및 제품 게재위치가 수익에 미치는 영향을 확인할 수 있습니다.
이 문서에서는 각 전자상거래 이벤트와 이벤트 설정 시점을 설명합니다. 전자상거래 이벤트 설정 방법에 대한 단계별 예는 구매 설정 참조 이벤트를 호출합니다.
시작하기 전에
웹사이트에 Google 태그를 추가하고 애널리틱스 및 웹사이트 소스 코드에 액세스할 수 있도록 하세요.
권장사항
- 실시간으로 이벤트를 확인하고 문제를 해결할 수 있도록 디버그 모드를 사용 설정합니다. 있습니다
- 맞춤 측정기준을 전송할 때 맞춤 측정기준 및 측정항목 한도를 검토하세요. 매개변수를 포함할 수 있습니다
- 수익 측정항목을 보장하기 위해
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
}
]
목록에서 항목 선택
사용자에게 결과 목록이 표시되면 view_item_list
이벤트를 전송합니다.
표시된 항목이 포함된 items
배열 매개변수를 포함합니다. 자세히 알아보기
자세한 내용은 이벤트
참조
gtag("event", "view_item_list", {
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
}
]
});
사용자가 목록에서 항목을 선택하면 items
배열 매개변수에서 선택한 항목과 함께 select_item
이벤트를 전송합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
gtag("event", "select_item", {
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
이벤트를 전송합니다. 이
자세한 내용은 이벤트
참조
gtag("event", "view_item", {
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
이벤트를 전송하여 장바구니에 추가되는 항목을 측정합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
gtag("event", "add_to_cart", {
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
}
]
});
또한
add_to_wishlist
이벤트를 items
배열의 관련 항목으로 연결합니다. 자세히 알아보기
자세한 내용은 이벤트
참조
gtag("event", "add_to_wishlist", {
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
이벤트를
표시됩니다. 전송할 매개변수에 대한 자세한 내용은 이벤트
참조
gtag("event", "view_cart", {
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
이벤트를 전송합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
gtag("event", "remove_from_cart", {
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
배열의 특정 요소에 추가하여 특정 상품에 적용할 수 있습니다. 대상
전송할 매개변수에 대한 자세한 내용은 이벤트
참조
gtag("event", "begin_checkout", {
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
매개변수를 사용하여 사용자의 배송 옵션(예: '지상', '항공' 또는 '익일')을 지정합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
gtag("event", "add_shipping_info", {
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
을 추가합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트
참조
gtag("event", "add_payment_info", {
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
이벤트를 전송하여 구매를 측정합니다. 전송할 매개변수에 대한 자세한 내용은 이벤트 참조를 참고하세요.
gtag("event", "purchase", {
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",
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
참고: 애널리틱스에서 상품 수준의 환불 측정항목을 확인하려면 이벤트에 상품 정보를 포함하는 것이 좋습니다.
전송할 매개변수에 대한 자세한 내용은 이벤트 참조
gtag("event", "refund", {
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
이벤트를 전송하여
프로모션 항목 전송할 매개변수에 대한 자세한 내용은 이벤트
참조
gtag("event", "view_promotion", {
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
이벤트를 전송합니다.
해당 항목을 항목 매개변수로 사용합니다. 전송할 매개변수에 대한 자세한 내용은
이벤트
참조
gtag("event", "select_promotion", {
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
}
],
});