gtm-ddata-datalayer-ecommerce

Implement GA4 e-commerce data layer events with standardized item objects.

77|9|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/henkisdabro/claudecode-marketplace --skill gtm-ddata-datalayer-ecommerce
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gtm-ddata-datalayer-ecommerce
Source: https://github.com/henkisdabro/claudecode-marketplace/tree/main/gtm-suite/skills/gtm-datalayer/references/ecommerce-datalayer.md
Command: npx skills add https://github.com/henkisdabro/claudecode-marketplace --skill gtm-ddata-datalayer-ecommerce

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides structured data layer patterns for ecommerce events (view_item, add_to_cart, purchase) aligned with GA4 expectations.

Core Features & Use Cases

  • Item Objects: Standard item properties inside ecommerce data layer.
  • Event Semantics: Map ecommerce events to GA4 data layer pushes.
  • Validation: Guidance to verify item_id, price, quantity, and totals.

Quick Start

Push a purchase event with a complete ecommerce.items array to the dataLayer.

Frequently Asked Questions about gtm-ddata-datalayer-ecommerce

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure ecommerce events in a GTM data layer for GA4?

Ecommerce events in GTM data layer require pushing objects with GA4-aligned properties to dataLayer. Structure purchase, add_to_cart, and view_item events with complete item arrays containing item_id, price, quantity, and totals to ensure GA4 captures transaction data correctly.

What's the best way to implement a data layer for single-page applications with GTM?

SPAs require virtual pageviews and event-driven dataLayer.push calls instead of page reloads. Initialize the data layer before GTM loads, push events on user actions, and maintain naming consistency across state changes to prevent duplicate or missed tracking.

How do I migrate my data layer from Universal Analytics to GA4?

Migrate by remapping UA event names and item properties to GA4 schemas, updating dataLayer.push syntax to match GA4 ecommerce structure, validating item_id and price formats, and testing virtual pageviews and event firing before deployment to ensure tracking continuity.

What validation should I apply to ecommerce item objects in the data layer?

Validate required properties: item_id uniqueness, price as numeric values, quantity as positive integers, and transaction totals against line-item sums. Enforce naming standardization and verify dataLayer.push timing occurs before GTM processes events to catch data quality issues early.

Can I use a GTM data layer pattern for debugging tracking issues?

Yes. Data layer patterns include documentation and naming standardization that make debugging easier. Verify dataLayer initialization timing, inspect pushed event objects for missing fields, confirm GA4 schema compliance, and trace event flow through GTM to identify tracking failures.

Do I need to enforce data privacy practices in my ecommerce data layer?

Yes. Data layer architecture should implement privacy safeguards: avoid capturing sensitive customer data, apply consent checks before pushing PII, redact or exclude restricted fields from item objects, and document data handling to meet regulatory requirements before GA4 transmission.