Advanced DataLayer Tracker – Complete WooCommerce Analytics
Table of Contents
- What is E-commerce Tracking?
- Quick Setup
- Events Tracked
- Enhanced E-commerce Features
- Customer Classification
- E-commerce Enrichment
- Refund Tracking
- Testing Your Setup
- Troubleshooting
- Best Practices
- ROI Examples
What is E-commerce Tracking?
E-commerce tracking captures the complete customer shopping journey from product browse to purchase, providing data to optimize your store’s performance.
What Gets Tracked:
Product View → Add to Cart → View Cart →
Begin Checkout → Shipping Info → Payment Info → Purchase
Plus Bonus Events:
- Product list views (category pages)
- Item selection from lists
- Cart removals
- Cart abandonment
- Refunds (server-side)
Why It Matters:
- Revenue Attribution: Know which marketing drives sales
- Funnel Optimization: Find where customers drop off
- Product Insights: Which products drive conversions
- Customer Segmentation: Identify high-value customers
- ROI Measurement: Track marketing ROI accurately
Quick Setup
Prerequisites
✅ WooCommerce Installed
- Version 3.0 or higher
- Active online store
✅ ADT Plugin Activated
- Premium license (e-commerce tracking is premium)
✅ GA4 Property (Optional but Recommended)
- For viewing reports
- Can set up later
Step 1: Enable E-commerce Tracking
Navigate to ADT settings:
WordPress Admin → Settings → Advanced DataLayer → E-commerce Tab
Basic Settings:
☑ Enable E-commerce Tracking
That’s it for basic setup! ADT automatically detects WooCommerce and starts tracking.
Step 2: Enhanced E-commerce (Optional)
Enable Additional Features:
☑ Enhanced E-commerce Tracking
- Product list tracking (category pages)
- Item selection tracking
- Checkout step tracking
E-commerce Enrichment (Premium):
☑ Enable E-commerce Enrichment
- Customer classification
- Lifetime value calculation
- Purchase frequency
- Session metrics
Customer Type Detection:
☑ Enable Customer Type Detection
- Automatic segmentation
- VIP identification
- Engaged prospect detection
Step 3: Verify Events Firing
Option A: Debug Overlay
- Add
?adt_debug=1to any page - Navigate through your store:
- View a product
- Add to cart
- View cart
- Go to checkout
- Check events appearing in overlay
Option B: Browser Console
// Open console (F12), type:
window.dataLayer
// Should see events like:
[
{ event: 'view_item', ecommerce: {...} },
{ event: 'add_to_cart', ecommerce: {...} },
{ event: 'begin_checkout', ecommerce: {...} }
]
Step 4: Connect to GA4 (Optional)
If using GTM:
- Export GTM container from ADT
- Import to Google Tag Manager
- Publish container
- E-commerce events automatically flow to GA4
If using GA4 Measurement Protocol:
- Configure GA4 MP in settings (see GA4 Setup Guide)
- Server-side tracking handles everything
- Events go directly to GA4
Result: Complete e-commerce tracking in 5 minutes!
Events Tracked
Core Events (Always Tracked)
1. view_item
Fires: Product page loads
What’s Tracked:
{
event: 'view_item',
ecommerce: {
currency: 'USD',
value: 49.99,
items: [{
item_id: 'SKU-12345', // Product SKU
item_name: 'Wireless Mouse', // Product name
item_brand: 'TechBrand', // Brand (if set)
item_category: 'Electronics', // Primary category
item_category2: 'Accessories', // Subcategory
item_variant: 'Black', // Variation (color/size)
price: 49.99,
quantity: 1
}]
}
}
Use Cases:
- Product popularity tracking
- Browse abandonment recovery
- Product recommendation optimization
- Interest-based remarketing
2. add_to_cart
Fires: User clicks “Add to Cart”
What’s Tracked:
{
event: 'add_to_cart',
ecommerce: {
currency: 'USD',
value: 49.99,
items: [{
item_id: 'SKU-12345',
item_name: 'Wireless Mouse',
price: 49.99,
quantity: 1
}]
}
}
Enhanced Data (Premium):
{
// Base event data...
ecommerce: {
// ...items array
// Enriched fields:
time_to_first_add: 45, // Seconds from landing to first add
cart_adds_session: 2, // Number of adds this session
add_to_cart_location: 'product', // Where: product/category/related
related_product_viewed: 'SKU-67890' // Previously viewed item
}
}
Use Cases:
- Conversion funnel entry point
- Product popularity
- Time-to-conversion analysis
- Cross-sell effectiveness
3. view_cart
Fires: Cart page loads
What’s Tracked:
{
event: 'view_cart',
ecommerce: {
currency: 'USD',
value: 149.97,
items: [
{
item_id: 'SKU-12345',
item_name: 'Wireless Mouse',
price: 49.99,
quantity: 1
},
{
item_id: 'SKU-67890',
item_name: 'Keyboard',
price: 99.99,
quantity: 1
}
]
}
}
Enhanced Data (Premium):
{
ecommerce: {
// ...items and value
// Cart-specific enrichments:
cart_age_minutes: 12, // Minutes since first item added
cart_unique_items: 2, // Number of different products
cart_total_quantity: 3, // Total items (if multiples)
cart_average_item_price: 74.99, // Average product price
cart_has_sale_items: true // Contains discounted items
}
}
Use Cases:
- Cart abandonment tracking
- Average cart value
- Product bundle analysis
- Upsell opportunities
4. remove_from_cart
Fires: User removes item from cart
What’s Tracked:
{
event: 'remove_from_cart',
ecommerce: {
currency: 'USD',
value: 49.99,
items: [{
item_id: 'SKU-12345',
item_name: 'Wireless Mouse',
price: 49.99,
quantity: 1
}]
}
}
Use Cases:
- Product friction identification
- Price sensitivity analysis
- Shipping cost impact
- Stock availability issues
5. begin_checkout
Fires: Checkout page loads
What’s Tracked:
{
event: 'begin_checkout',
ecommerce: {
currency: 'USD',
value: 149.97,
items: [...]
}
}
Use Cases:
- Checkout entry rate
- Cart-to-checkout conversion
- Guest vs. member checkout
- Coupon usage
6. add_shipping_info
Fires: Shipping information entered
What’s Tracked:
{
event: 'add_shipping_info',
ecommerce: {
currency: 'USD',
value: 149.97,
shipping_tier: 'Standard', // Shipping method selected
items: [...]
}
}
Use Cases:
- Shipping method preferences
- Shipping cost impact
- Express vs. standard conversion
- Checkout progress tracking
7. add_payment_info
Fires: Payment method selected
What’s Tracked:
{
event: 'add_payment_info',
ecommerce: {
currency: 'USD',
value: 149.97,
payment_type: 'credit_card', // Payment method
items: [...]
}
}
Use Cases:
- Payment method preferences
- Payment failures
- Alternative payment adoption
- Checkout drop-off analysis
8. purchase
Fires: Order completes (thank you page)
What’s Tracked:
{
event: 'purchase',
ecommerce: {
transaction_id: 'ORDER-12345', // Unique order ID
affiliation: 'Online Store',
value: 164.96, // Total order value
tax: 14.99,
shipping: 0.00,
currency: 'USD',
coupon: 'SAVE15', // Coupon code (if used)
items: [{
item_id: 'SKU-12345',
item_name: 'Wireless Mouse',
price: 49.99,
quantity: 1,
item_brand: 'TechBrand',
item_category: 'Electronics'
}]
}
}
Enhanced Data (Premium):
{
ecommerce: {
// ...base purchase data
// Customer enrichment:
customer_type: 'repeat_buyer', // Classification
customer_lifetime_value: 487.50, // Total LTV
customer_order_count: 3, // Previous orders
days_since_last_purchase: 45, // Recency
customer_value_score: 68, // 0-100 score
customer_tags: 'vip,loyal', // Segments
// Session data:
session_duration_seconds: 342,
session_page_views: 8,
products_viewed_count: 12
}
}
Use Cases:
- Revenue tracking
- Customer lifetime value
- Attribution modeling
- Repeat purchase analysis
- Marketing ROI
Enhanced Events (Premium)
9. view_item_list
Fires: Category/shop page loads
What’s Tracked:
{
event: 'view_item_list',
ecommerce: {
item_list_id: 'electronics',
item_list_name: 'Electronics',
items: [
{ item_id: 'SKU-001', item_name: 'Mouse', price: 49.99, index: 1 },
{ item_id: 'SKU-002', item_name: 'Keyboard', price: 99.99, index: 2 },
// ...more products
]
}
}
Use Cases:
- Product listing optimization
- Search result analysis
- Category performance
- Product position impact
10. select_item
Fires: User clicks product in list
What’s Tracked:
{
event: 'select_item',
ecommerce: {
item_list_id: 'electronics',
item_list_name: 'Electronics',
items: [{
item_id: 'SKU-12345',
item_name: 'Wireless Mouse',
index: 3 // Position in list
}]
}
}
Use Cases:
- Click-through rates
- Product position optimization
- Listing effectiveness
- Search quality
11. cart_abandonment
Fires: User has cart, exits site
What’s Tracked:
{
event: 'cart_abandonment',
ecommerce: {
value: 149.97,
items: [...],
abandonment_reason: 'exit_intent',
time_in_cart: 320 // Seconds
}
}
Use Cases:
- Abandonment recovery
- Exit intent triggers
- Email remarketing
- Abandonment rate tracking
12. refund
Fires: Admin processes refund (server-side)
What’s Tracked:
{
event: 'refund',
ecommerce: {
transaction_id: 'ORDER-12345',
value: 49.99,
currency: 'USD',
affiliation: 'Online Store',
items: [{
item_id: 'SKU-12345',
item_name: 'Wireless Mouse',
price: 49.99,
quantity: 1
}]
},
refund_meta: {
refund_id: 'REF-789',
refund_reason: 'Customer request',
refund_date: '2024-10-22 15:30:00',
refund_type: 'partial' // or 'full'
}
}
Special Features:
- Fires server-side (admin action)
- Bypasses consent (not user tracking)
- Immediate GA4 MP send
- Frontend dataLayer push for GTM Preview
Use Cases:
- Revenue accuracy
- Product quality issues
- Return rate analysis
- Customer satisfaction
Enhanced E-commerce Features
Feature 1: E-commerce Enrichment
What It Does: Automatically adds 10+ contextual data points to every e-commerce event.
Enriched Fields:
Session Metrics:
session_duration_seconds– Total time on sitesession_page_views– Pages viewed this sessionproducts_viewed_count– Products browsed
Customer Classification:
customer_type– Primary segment (10+ types)customer_tags– All applicable tagscustomer_confidence– Classification accuracy (0-1)customer_value_score– Value rating (0-100)
Add to Cart Specific:
time_to_first_add– Seconds to first add actioncart_adds_session– Add count this sessionadd_to_cart_location– Where added (product/category/related)related_product_viewed– Previously viewed item
Cart Specific:
cart_age_minutes– Time since first item addedcart_unique_items– Number of different productscart_total_quantity– Total items in cartcart_average_item_price– Average product pricecart_has_sale_items– Contains discounted items
Configuration:
Settings → E-commerce → ☑ Enable E-commerce Enrichment
Example Enriched Event:
{
event: 'add_to_cart',
ecommerce: {
value: 49.99,
items: [{...}],
// Base enrichments (all events):
session_duration_seconds: 124,
session_page_views: 5,
products_viewed_count: 8,
customer_type: 'engaged_prospect',
customer_tags: 'window_shopper,price_sensitive',
customer_confidence: 0.75,
customer_value_score: 42,
// Event-specific enrichments:
time_to_first_add: 45,
cart_adds_session: 1,
add_to_cart_location: 'product',
related_product_viewed: 'SKU-67890'
}
}
ROI Impact:
- Identify high-intent users → Personalized messaging → +23% conversion
- Segment customers automatically → Targeted campaigns → +41% ROAS
- Detect abandonment signals → Exit intent offers → Recovered $47K/month
Feature 2: Customer Classification
What It Does: Automatically segments customers into 10+ types based on real-time behavior.
Customer Types:
1. VIP Customer
- Multiple high-value purchases
- High lifetime value
- Frequent buyer
- Action: White-glove service, exclusive offers
2. Loyal Customer
- 3+ purchases
- Regular return visitor
- Strong brand affinity
- Action: Loyalty rewards, early access
3. Repeat Buyer
- 2+ purchases
- Moderate lifetime value
- Consistent behavior
- Action: Upsell campaigns, subscriptions
4. One-Time Buyer
- Single purchase
- No return visits
- Action: Win-back campaigns, discounts
5. Engaged Prospect
- Multiple product views
- High engagement
- No purchase yet
- Action: Strong CTAs, limited-time offers
6. Window Shopper
- Multiple visits
- Browses but doesn’t engage
- Low intent signals
- Action: Retargeting, social proof
7. Cart Abandoner
- Added to cart
- Left without purchasing
- Action: Cart recovery emails, discounts
8. Price Sensitive
- Searches for deals
- Views sale items
- Hesitates at checkout
- Action: Discount offers, payment plans
9. Impulse Buyer
- Quick decisions
- Fast checkout
- Higher AOV
- Action: Limited-time offers, urgency
10. Dormant Customer
- Previous buyer
- No recent activity
- Action: Win-back campaigns, “We miss you”
Plus More:
- New Visitor
- High-Intent Visitor
- Research Phase
- Comparison Shopper
How Classification Works:
// Real-time behavior scoring:
Points for:
+ Product views (1 point each)
+ Add to cart (5 points)
+ Return visits (3 points)
+ Time on site (1 point per minute)
+ Purchase (50 points)
Classification based on:
- Point total
- Behavior patterns
- Purchase history
- Engagement metrics
Confidence Scores:
0.0 - 0.25: Low confidence (need more data)
0.25 - 0.50: Moderate confidence
0.50 - 0.75: High confidence
0.75 - 1.00: Very high confidence
Configuration:
Settings → E-commerce → ☑ Enable Customer Type Detection
Accessing Customer Type:
In Events:
{
event: 'add_to_cart',
ecommerce: {
customer_type: 'engaged_prospect',
customer_tags: 'price_sensitive,window_shopper',
customer_confidence: 0.82,
customer_value_score: 65
}
}
In JavaScript:
// Get current classification
const customerData = window.CustomerType.getCustomerType();
console.log(customerData);
// Output:
// {
// primary: 'engaged_prospect',
// tags: ['price_sensitive', 'window_shopper'],
// confidence: 0.82,
// valueScore: 65
// }
Use Cases:
Dynamic Pricing:
if (customerType === 'vip_customer') {
// Show premium products
// Offer free shipping
}
Personalized Messaging:
if (customerType === 'price_sensitive') {
// Show discount banner
// Highlight sale items
}
Email Segmentation:
-- Target cart abandoners with discount
SELECT email FROM customers
WHERE customer_type = 'cart_abandoner'
AND last_visit > DATE_SUB(NOW(), INTERVAL 24 HOUR)
Exit Intent:
if (customerType === 'engaged_prospect') {
// Aggressive exit offer (they're close!)
} else if (customerType === 'window_shopper') {
// Soft nurture message
}
ROI Examples:
Example 1: Segmented Email Campaign
Before: Generic 15% off to all cart abandoners
- Open rate: 22%
- Conversion: 8%
- Revenue: $12K
After: Segmented offers by customer type
- VIP: Free shipping + early access
- Price Sensitive: 25% off
- Engaged Prospect: 15% off + urgency
- Window Shopper: Social proof email
Results:
- Open rate: 34% (+55%)
- Conversion: 19% (+138%)
- Revenue: $31K (+158%)
Example 2: On-Site Personalization
Before: Same homepage for everyone
After: Dynamic content by segment
- VIP: Premium products, concierge chat
- Price Sensitive: Sale items, discount banner
- New Visitor: Social proof, best sellers
Results:
- Engagement: +42%
- Add-to-cart rate: +28%
- Revenue: +$67K/month
Feature 3: Lifetime Value Calculation
What It Does: Automatically calculates and tracks customer lifetime value (CLV/LTV) in real-time.
Metrics Tracked:
Purchase Metrics:
- Total purchases (count)
- Total spend (value)
- Average order value
- Purchase frequency
- Days since last purchase
- Days since first purchase
Calculated Values:
- Current lifetime value
- Predicted lifetime value (ML-based)
- Value score (0-100)
- Customer rank (percentile)
How It’s Calculated:
// Base LTV
lifetime_value = sum(all_purchases)
// Value Score (0-100)
value_score = min(100, (lifetime_value / $1000) * 100)
// $1000 = score of 100
// Enhanced with frequency
enhanced_score = value_score * (1 + (purchase_count * 0.1))
// Each purchase adds 10% bonus
// Recency factor
recency_multiplier = days_since_last_purchase < 30 ? 1.2 :
days_since_last_purchase < 90 ? 1.0 : 0.8
final_score = enhanced_score * recency_multiplier
Accessing LTV Data:
In Purchase Event:
{
event: 'purchase',
ecommerce: {
transaction_id: 'ORDER-789',
value: 99.99,
// LTV fields:
customer_lifetime_value: 487.50, // Total all-time
customer_order_count: 5, // Previous + current
customer_average_order: 97.50,
days_since_last_purchase: 34,
days_since_first_purchase: 287,
customer_value_score: 48, // 0-100
customer_rank_percentile: 72 // Top 28%
}
}
Use Cases:
VIP Identification:
-- Find top 20% customers
SELECT * FROM customers
WHERE customer_value_score >= 80
OR customer_lifetime_value > 500
Win-Back Campaigns:
-- High-value customers who haven't purchased recently
SELECT * FROM customers
WHERE customer_lifetime_value > 200
AND days_since_last_purchase > 90
Acquisition ROI:
-- Compare LTV to acquisition cost
SELECT
utm_source,
AVG(customer_lifetime_value) as avg_ltv,
AVG(acquisition_cost) as avg_cac,
AVG(customer_lifetime_value) - AVG(acquisition_cost) as profit
FROM customers
GROUP BY utm_source
ORDER BY profit DESC
Dynamic Discounting:
// Offer size based on LTV
if (customer_lifetime_value > 1000) {
offer = '25% off'; // Reward loyalty
} else if (customer_lifetime_value > 500) {
offer = '15% off';
} else {
offer = '10% off'; // New customers
}
ROI Example:
Scenario: E-commerce store, $500K/year revenue
Before LTV Tracking:
- Treated all customers equally
- Generic 15% off for everyone
- Customer acquisition focus
After LTV Segmentation:
- Top 20% (LTV >$500): VIP treatment, free shipping, priority support
- Middle 30% (LTV $200-$500): Standard loyalty program
- Bottom 50% (LTV <$200): Basic service
Results:
- Top 20% repeat rate: 68% → 89% (+31%)
- Top 20% AOV: $97 → $134 (+38%)
- Marketing efficiency: +54% (stopped discounting VIPs)
- Net revenue impact: +$127K/year
Refund Tracking
Special Feature: Server-side refund tracking with dual-path delivery.
How It Works
When Refund Processed:
1. Admin processes refund in WooCommerce
2. ADT captures refund data immediately
3. TWO tracking paths fire simultaneously:
PATH 1 (Belt): Server-Side GA4
- Sends directly to GA4 Measurement Protocol
- Cannot be blocked
- Immediate delivery
PATH 2 (Suspenders): Frontend DataLayer
- Stores in WordPress transient
- Pushes to dataLayer on admin's next page view
- GTM Preview can see it
- Two-push pattern for GTM visibility
Why This Matters
Problem: Refunds are admin actions (backend) Challenge: GTM/GA4 are frontend tools Solution: Dual-path tracking
Benefits:
- ✅ Belt: GA4 MP ensures refund tracked even if admin closes browser
- ✅ Suspenders: DataLayer push allows GTM debugging/verification
- ✅ Consent Bypass: Refunds aren’t user tracking (admin actions)
- ✅ GTM Preview: Can see refund in Preview mode
Refund Event Data
{
event: 'refund',
ecommerce: {
transaction_id: 'ORDER-12345',
value: 149.97, // Refund amount
currency: 'USD',
affiliation: 'Online Store',
items: [{
item_id: 'SKU-12345',
item_name: 'Wireless Mouse',
price: 49.99,
quantity: 1
}]
},
refund_meta: {
refund_id: 'REF-789',
refund_reason: 'Customer request',
refund_date: '2024-10-22 15:30:00',
order_id: '12345',
refund_type: 'partial' // or 'full'
}
}
Configuration
Automatic: Enabled when both are true:
- E-commerce tracking enabled
- GA4 Measurement Protocol configured
No additional setup required!
Testing Refunds
Step 1: Process Test Refund
1. WooCommerce → Orders
2. Open any order
3. Click "Refund"
4. Enter refund amount
5. Add reason (optional)
6. Click "Refund via [Payment Method]"
Step 2: Verify Server-Side Send
Check WordPress debug log:
[ADT] Refund server-side: Event sent successfully
[ADT] Response code: 204
Step 3: Verify Frontend DataLayer
1. Stay logged in as admin
2. Navigate to any frontend page
3. Open browser console (F12)
4. Type: window.dataLayer
5. Should see refund event
Step 4: Verify GTM Preview (Optional)
1. Open GTM Preview mode
2. Navigate frontend page
3. Check "Tags Fired"
4. Should see "GA4 Event - Refund" tag
Step 5: Verify in GA4
1. GA4 → DebugView (if debug mode enabled)
2. Or GA4 → Reports → Realtime
3. Look for "refund" events
4. Check event parameters
Use Cases
Revenue Accuracy:
Gross Revenue: $50,000
Refunds: -$2,100
Net Revenue: $47,900
Without refund tracking: Overstated by 4.4%
Product Quality Issues:
-- Products with high refund rates
SELECT
item_name,
COUNT(*) as refunds,
SUM(value) as refunded_amount,
AVG(value) as avg_refund
FROM refunds
GROUP BY item_name
ORDER BY refunds DESC
Refund Reason Analysis:
-- Most common refund reasons
SELECT
refund_reason,
COUNT(*) as count,
SUM(value) as total_refunded
FROM refunds
WHERE refund_date > DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY refund_reason
ORDER BY count DESC
Customer Refund Behavior:
-- Frequent refunders
SELECT
customer_email,
COUNT(*) as refund_count,
SUM(value) as total_refunded
FROM refunds
GROUP BY customer_email
HAVING refund_count > 2
ORDER BY refund_count DESC
Testing Your Setup
Method 1: Complete Checkout Flow Test
Test Scenario: Full Purchase
Step 1: Product View
- Visit product page
- Console: Check for view_item event
- Verify product details accurate
Step 2: Add to Cart
- Click "Add to Cart"
- Console: Check for add_to_cart event
- Verify item added correctly
Step 3: View Cart
- Go to cart page
- Console: Check for view_cart event
- Verify all cart items listed
Step 4: Begin Checkout
- Click "Proceed to Checkout"
- Console: Check for begin_checkout event
- Verify cart value correct
Step 5: Shipping Info
- Enter shipping address
- Check for add_shipping_info event
- Verify shipping method captured
Step 6: Payment Info
- Select payment method
- Check for add_payment_info event
- Verify payment type captured
Step 7: Purchase
- Complete order
- On thank you page: Check for purchase event
- Verify transaction_id, value, items correct
Checklist:
- ✅ All 7 events fired
- ✅ Product data accurate
- ✅ Currency correct
- ✅ Transaction ID unique
- ✅ Total matches order
Method 2: Debug Overlay Testing
Enable Overlay:
Add ?adt_debug=1 to any page
What to Check:
E-commerce Tab:
- Shows recent e-commerce events
- Event count
- Total value tracked
- Customer classification
Events Tab:
- Real-time event feed
- Event parameters
- Timestamp
- Event source
Console Tab:
- Debug messages
- Errors (if any)
- Enrichment logs
Method 3: GTM Preview Testing
Steps:
1. Open GTM → Preview
2. Connect to your site
3. Complete checkout flow
4. Check GTM Preview panel:
- Tags Fired section
- Variables section
- Data Layer tab
Verify:
- ✅ All e-commerce tags fire
- ✅ Variables populated correctly
- ✅ Ecommerce object structure correct
- ✅ Items array complete
Method 4: GA4 Verification
Real-Time Reports:
GA4 → Reports → Realtime
Look for:
- Event count by event name
- Ecommerce purchases
- Item revenue
DebugView (Recommended):
1. Enable GA4 Debug Mode in ADT settings
2. GA4 → Configure → DebugView
3. Complete checkout
4. See events in real-time with full parameters
Standard Reports (Wait 24-48 hours):
GA4 → Reports → Monetization → Ecommerce purchases
Check:
- Purchase count
- Revenue
- Average purchase revenue
- Items per purchase
Troubleshooting
Issue: No E-commerce Events Firing
Symptoms:
- No events in console
- Debug overlay shows 0 e-commerce events
- GTM Preview shows no e-commerce tags
Diagnostic Steps:
1. Verify E-commerce Tracking Enabled:
Settings → E-commerce → ☑ Enable E-commerce Tracking
2. Check Premium License:
Settings → License → Verify "Active" status
E-commerce tracking requires premium
3. Verify WooCommerce Active:
Plugins → Check "WooCommerce" activated
Must be WooCommerce 3.0+
4. Check JavaScript Errors:
Browser Console (F12) → Console Tab
Look for red errors
Common issue: JavaScript conflict with theme/plugin
5. Test with Default Theme:
Temporarily switch to Twenty Twenty-Four
If events fire → Theme conflict
If still not firing → Plugin conflict or configuration issue
Solutions:
- Enable e-commerce tracking if disabled
- Activate premium license
- Update WooCommerce to latest version
- Disable conflicting plugins one by one
- Contact support with console errors
Issue: Purchase Event Not Firing
Symptoms:
- Other events work (view_item, add_to_cart)
- But purchase event missing on thank you page
- Revenue not tracked in GA4
Diagnostic Steps:
1. Verify Thank You Page Loads:
Complete test order
Confirm redirect to /checkout/order-received/ page
2. Check Console on Thank You Page:
F12 → Console
Look for purchase event in window.dataLayer
Should see: {event: 'purchase', ecommerce: {...}}
3. Check Order Data Extraction:
Console should show:
"Order data extracted: {transaction_id: ...}"
If not shown:
- Order ID may not be detected
- WooCommerce structure may have changed
4. Check for Duplicate Prevention:
Console may show:
"Purchase already tracked for order #123"
This is GOOD - prevents duplicate tracking
Refresh page should NOT fire purchase again
5. Verify WooCommerce Structure:
Check page source for:
- .woocommerce-order-overview element
- Order number in markup
- Order details present
Solutions:
Missing Order Data:
// Manual purchase tracking if auto-detection fails
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: 'ORDER-123',
value: 99.99,
currency: 'USD',
tax: 9.00,
shipping: 5.00,
items: [{
item_id: 'SKU-001',
item_name: 'Product Name',
price: 85.99,
quantity: 1
}]
}
});
Contact Support If:
- Using custom thank you page
- Using third-party checkout
- WooCommerce heavily customized
Issue: Incorrect Product Data
Symptoms:
- Events fire but data wrong/incomplete
- Missing item_category
- Missing item_brand
- Wrong prices
Diagnostic Steps:
1. Check Product Setup in WooCommerce:
Products → Check product:
- Categories assigned?
- Price set correctly?
- SKU filled in?
- Variations configured?
2. Check Event Data in Console:
// View actual event data
window.dataLayer[window.dataLayer.length - 1]
// Compare to WooCommerce product data
3. Check Currency Settings:
WooCommerce → Settings → General → Currency
Ensure correct currency selected
Solutions:
Missing Categories:
Products → Categories
Assign categories to products
ADT uses primary category + subcategories
Missing Brand:
WooCommerce doesn't have built-in brand field
Options:
1. Use product attribute "brand"
2. Use custom field "_brand"
3. Or leave empty (not critical)
Wrong Prices:
Check:
- Sale price vs. regular price
- Tax settings (inclusive vs. exclusive)
- Currency decimals
Issue: Enrichment Data Missing
Symptoms:
- E-commerce events fire
- But missing enriched fields:
- customer_type
- session_duration_seconds
- etc.
Diagnostic Steps:
1. Verify Enrichment Enabled:
Settings → E-commerce → ☑ Enable E-commerce Enrichment
2. Check Premium License:
E-commerce enrichment requires premium
Settings → License → Verify active
3. Check Console for Errors:
Look for:
"CustomerType not initialized"
"Enrichment module not loaded"
4. Verify Script Load Order:
View page source
Check loading order:
1. adt-utils-lite.js
2. adt-customer-type.js
3. adt-ecommerce-enrichment.js
4. adt-ecommerce-lite.js
Solutions:
- Enable enrichment if disabled
- Verify premium license active
- Clear cache (browser + WordPress)
- Check for JavaScript conflicts
- Update ADT to latest version
Issue: Customer Type Always “Unknown”
Symptoms:
ecommerce.customer_type: 'unknown'
ecommerce.customer_confidence: 0
Cause: Customer Type requires data to classify:
- Need 2+ data points for classification
- New visitors start as “unknown”
- Confidence builds over session
How to Get Classification:
Option 1: Build Session Data
Actions that increase confidence:
+ View 2+ products
+ Add to cart
+ Multiple page views
+ Time on site >60 seconds
Option 2: Historical Data
Return visitors automatically classified based on:
- Previous purchases
- Browse history
- Engagement patterns
Testing Classification:
1. Clear cookies
2. View 5+ products
3. Add item to cart
4. Check customer_type in next event
Should be 'engaged_prospect' or similar
Best Practices
Data Quality
1. Keep Products Well-Organized
✓ All products have categories
✓ SKUs are unique and meaningful
✓ Prices accurate
✓ Stock status correct
✓ Variations properly configured
2. Use Consistent Naming
✓ Category names consistent
✓ Product names descriptive
✓ Variants clear (Size/Color)
✓ Attributes standardized
3. Test Before Launch
✓ Complete full checkout flow
✓ Test all product types
✓ Verify all events fire
✓ Check GA4 receiving data
✓ Validate revenue matches
Performance
1. Optimize Tracking Load
✓ Events fire asynchronously
✓ No page load impact
✓ Queue events if needed
✓ Batch updates when possible
2. Cache Considerations
✓ Works with page caching
✓ Dynamic event tracking
✓ No cache conflicts
✓ Session persistence
Privacy & Compliance
1. Respect Consent
✓ Check consent before tracking
✓ Honor opt-outs
✓ Clear consent policies
✓ GDPR/CCPA compliant
2. PII Handling
✗ Never send email addresses
✗ Never send phone numbers
✗ Never send full names
✓ Use customer IDs only
✓ Hash if needed
3. Refund Privacy
✓ Refunds bypass consent (admin actions)
✓ But still respect privacy laws
✓ No customer PII in refunds
✓ Order IDs only
Reporting & Analysis
1. Key Metrics to Monitor
Daily:
- Conversion rate
- Revenue
- AOV (average order value)
Weekly:
- Cart abandonment rate
- Checkout drop-off points
- Top products
- Customer segments
Monthly:
- Customer lifetime value
- Repeat purchase rate
- Attribution by source
- Product performance
2. Set Up GA4 Conversions
GA4 → Configure → Events
Mark as conversion:
✓ purchase
✓ add_to_cart (micro-conversion)
✓ begin_checkout (micro-conversion)
3. Create Custom Reports
GA4 → Explore
Reports to create:
- Product performance
- Customer lifetime value
- Funnel analysis
- Cart abandonment
ROI Examples
Example 1: Cart Abandonment Recovery
Scenario: E-commerce store, 1,000 visitors/day
Before ADT:
Monthly Metrics:
- Cart creations: 300
- Purchases: 120
- Abandonment rate: 60%
- No recovery process
After ADT:
Setup:
1. Enabled cart_abandonment event
2. Connected to email platform (Klaviyo)
3. Created 3-email recovery sequence:
- Email 1: 1 hour after abandon (reminder)
- Email 2: 24 hours (10% discount)
- Email 3: 48 hours (15% discount)
Results:
- Abandons tracked: 180/month
- Recovery emails sent: 540
- Recovered sales: 32 (18% recovery rate)
- Average order: $87
- Monthly recovered revenue: $2,784
- Annual impact: $33,408
- Email platform cost: $50/month
- Net gain: $32,808/year
Example 2: Customer Segmentation
Scenario: Fashion retailer, $300K/year revenue
Before ADT:
Marketing approach:
- Same messaging for everyone
- Generic 15% off promotions
- No segmentation
- Email blast strategy
After ADT:
Setup:
1. Enabled customer type detection
2. Created segment-specific campaigns:
VIP Customers (Top 10%):
- Free shipping always
- Early access to sales
- Personal stylist
- 20% off birthday month
Loyal Customers (Next 20%):
- Loyalty points program
- Exclusive previews
- 15% off promotions
Engaged Prospects:
- First purchase 10% off
- Style quiz for recommendations
- Cart abandonment 15% off
Price Sensitive:
- Sale notifications
- Clearance alerts
- Payment plans offered
Results by Segment:
- VIP repeat rate: 55% → 78%
- VIP AOV: $120 → $156
- Loyal repeat rate: 35% → 51%
- Engaged conversion: 8% → 14%
- Price Sensitive conversion: 6% → 11%
Overall Impact:
- Total revenue: $300K → $423K (+41%)
- Marketing efficiency: +67% (better targeting)
- Customer satisfaction: +34% (relevant offers)
- ROI: $123K additional profit
Example 3: Product Optimization
Scenario: Electronics store, 50 products
Before ADT:
Product decisions:
- Intuition-based
- No data on browse behavior
- No add-to-cart tracking
- No drop-off analysis
After ADT:
Setup:
1. Enabled view_item + add_to_cart tracking
2. Created GA4 reports:
- View-to-cart rate by product
- Cart-to-purchase rate
- Drop-off points
Analysis (30 days):
Product A: Wireless Mouse
- Views: 1,200
- Add-to-cart: 84 (7% rate) ← LOW
- Purchases: 52 (62% of carts)
- Issue: Low add-to-cart rate
- Action: Improved product photos, added reviews
- Result: Add-to-cart → 156 (13%)
Product B: USB-C Hub
- Views: 800
- Add-to-cart: 240 (30% rate) ← GOOD
- Purchases: 48 (20% of carts) ← LOW
- Issue: High cart abandonment
- Action: Found shipping cost too high
- Result: Reduced shipping, purchases → 132 (55%)
Product C: Webcam
- Views: 200
- Add-to-cart: 68 (34%)
- Purchases: 51 (75%)
- Issue: Low visibility
- Action: Featured on homepage
- Result: Views → 650, add-to-cart → 234
Overall Results:
- Store conversion rate: 2.1% → 3.8%
- Revenue: +$47K/month
- Identified 3 underperforming products → discontinued
- Featured 2 high-converters → doubled sales
Example 4: Checkout Optimization
Scenario: SaaS company with e-commerce
Before ADT:
Checkout funnel:
- Begin checkout: 100
- Complete purchase: 45
- Conversion: 45%
- No step-level data
After ADT:
Setup:
1. Enabled checkout step tracking
2. Analyzed drop-off by step
Findings:
Step 1 (Cart → Checkout): 100 → 87 (13% drop)
- Issue: Unexpected shipping costs
- Fix: Show shipping costs earlier
- Result: 100 → 94 (6% drop)
Step 2 (Checkout → Shipping): 87 → 68 (22% drop) ← BIGGEST
- Issue: Complex form, required account
- Fix: Guest checkout, simplified form
- Result: 94 → 89 (5% drop)
Step 3 (Shipping → Payment): 68 → 58 (15% drop)
- Issue: Limited payment options
- Fix: Added PayPal, Apple Pay
- Result: 89 → 84 (6% drop)
Step 4 (Payment → Purchase): 58 → 45 (22% drop)
- Issue: Security concerns
- Fix: Trust badges, SSL indicators
- Result: 84 → 75 (11% drop)
Overall Results:
- Checkout completion: 45% → 75%
- Revenue: +$2,900/month
- Annual impact: $34,800
- Implementation cost: $3,500 (one-time)
- Payback: 1.2 months
Summary
E-commerce Tracking Checklist:
Setup:
- ✅ WooCommerce installed
- ✅ ADT premium license active
- ✅ E-commerce tracking enabled
- ✅ Enhanced features enabled (optional)
- ✅ Customer classification enabled (optional)
- ✅ E-commerce enrichment enabled (optional)
Testing:
- ✅ Complete checkout flow tested
- ✅ All events firing correctly
- ✅ Product data accurate
- ✅ Revenue matches orders
- ✅ GTM/GA4 receiving data
Optimization:
- ✅ Products well-organized
- ✅ Categories assigned
- ✅ SKUs unique
- ✅ Prices accurate
Monitoring:
- ✅ Daily revenue check
- ✅ Weekly funnel analysis
- ✅ Monthly customer segments
- ✅ Quarterly optimization
Privacy:
- ✅ Consent respected
- ✅ No PII tracked
- ✅ Privacy policy updated
- ✅ GDPR/CCPA compliant
You now have enterprise-level e-commerce tracking! 🎉
Start optimizing your store with data-driven insights.
Need Help?
- Documentation: Complete Event Documentation
- Support: WordPress Admin → Advanced DataLayer → Support
- Community: