Files
our-claude-skills/ourdigital-custom-skills/13-ourdigital-gtm-audit/docs/ecommerce_schema.md
Andrew Yim 31506e026d refactor(gtm): Split into lightweight audit and comprehensive manager
- 13-ourdigital-gtm-audit: Lightweight audit-only tool (original)
  - GTM container validation
  - DataLayer event checking
  - Form and checkout analysis
  - No Notion integration, no inject mode

- 14-ourdigital-gtm-manager: Comprehensive management toolkit
  - Full audit capabilities
  - DataLayerInjector for custom HTML tag generation
  - Notion integration for audit logging
  - 20+ GA4 event templates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 22:46:16 +09:00

4.1 KiB

E-commerce DataLayer Schema Reference

GA4 E-commerce Structure

Items Array Schema

Every e-commerce event requires an items array:

items: [{
  // Required
  item_id: "SKU_12345",
  item_name: "Blue T-Shirt",
  
  // Recommended
  affiliation: "Store Name",
  coupon: "SUMMER_SALE",
  discount: 5.00,
  index: 0,
  item_brand: "Brand Name",
  item_category: "Apparel",
  item_category2: "Men",
  item_category3: "Shirts",
  item_category4: "T-Shirts",
  item_category5: "Short Sleeve",
  item_list_id: "related_products",
  item_list_name: "Related Products",
  item_variant: "Blue/Large",
  location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
  price: 29.99,
  quantity: 1
}]

Clear Previous E-commerce Data

Always clear before new e-commerce event:

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "view_item",
  ecommerce: {
    // new data
  }
});

Complete Purchase Flow

1. Product List View

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "view_item_list",
  ecommerce: {
    item_list_id: "category_results",
    item_list_name: "Category Results",
    items: [
      { item_id: "SKU_001", item_name: "Product 1", index: 0, price: 29.99 },
      { item_id: "SKU_002", item_name: "Product 2", index: 1, price: 39.99 }
    ]
  }
});

2. Product Click

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "select_item",
  ecommerce: {
    item_list_id: "category_results",
    item_list_name: "Category Results",
    items: [{
      item_id: "SKU_001",
      item_name: "Product 1",
      price: 29.99
    }]
  }
});

3. Product Detail View

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "view_item",
  ecommerce: {
    currency: "USD",
    value: 29.99,
    items: [{
      item_id: "SKU_001",
      item_name: "Product 1",
      item_brand: "Brand",
      item_category: "Category",
      price: 29.99,
      quantity: 1
    }]
  }
});

4. Add to Cart

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "add_to_cart",
  ecommerce: {
    currency: "USD",
    value: 29.99,
    items: [{
      item_id: "SKU_001",
      item_name: "Product 1",
      price: 29.99,
      quantity: 1
    }]
  }
});

5. View Cart

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "view_cart",
  ecommerce: {
    currency: "USD",
    value: 59.98,
    items: [
      { item_id: "SKU_001", item_name: "Product 1", price: 29.99, quantity: 1 },
      { item_id: "SKU_002", item_name: "Product 2", price: 29.99, quantity: 1 }
    ]
  }
});

6. Begin Checkout

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "begin_checkout",
  ecommerce: {
    currency: "USD",
    value: 59.98,
    coupon: "DISCOUNT10",
    items: [...]
  }
});

7. Add Shipping Info

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "add_shipping_info",
  ecommerce: {
    currency: "USD",
    value: 59.98,
    shipping_tier: "Standard",
    items: [...]
  }
});

8. Add Payment Info

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "add_payment_info",
  ecommerce: {
    currency: "USD",
    value: 59.98,
    payment_type: "Credit Card",
    items: [...]
  }
});

9. Purchase

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: "purchase",
  ecommerce: {
    transaction_id: "T_12345",
    value: 65.97,
    tax: 4.99,
    shipping: 5.99,
    currency: "USD",
    coupon: "DISCOUNT10",
    items: [{
      item_id: "SKU_001",
      item_name: "Product 1",
      affiliation: "Online Store",
      coupon: "DISCOUNT10",
      discount: 3.00,
      item_brand: "Brand",
      item_category: "Category",
      price: 29.99,
      quantity: 1
    }]
  }
});

Korean E-commerce Considerations

Currency

currency: "KRW",
value: 35000  // No decimals for KRW

Common Korean Platform Integrations

  • Cafe24: Uses custom dataLayer structure
  • Shopify Korea: Standard GA4 format
  • Naver SmartStore: Custom pixel implementation