This document provides comprehensive documentation for the Ra Ecommerce Analytics LookML project, including setup instructions, architecture overview, and usage guidelines.
- Overview
- Project Structure
- Recent Updates
- Setup Instructions
- View Files Documentation
- Model and Explores
- Dashboards
- Best Practices
- Deployment Guide
The Ra Ecommerce Analytics LookML project provides a comprehensive business intelligence layer on top of the dbt-transformed data warehouse. It includes:
- 16 View Files: Representing fact and dimension tables with calculated dimensions and measures
- 12 Explores: Pre-configured analysis paths for different use cases including attribution analysis
- 3 LookML Dashboards: Executive Overview, Sales & Orders Analytics, and Data Quality Monitoring
- Advanced Features: Multi-touch attribution, SCD Type 2 support, data quality monitoring, and comprehensive KPI tracking
lookml/
├── models/
│ └── ecommerce_demo.model.lkml # Main model with all explores
├── views/
│ ├── dim_channels.view.lkml # Channel dimension
│ ├── dim_customer_metrics.view.lkml # Customer metrics dimension
│ ├── dim_customers.view.lkml # Customer dimension
│ ├── dim_date.view.lkml # Date dimension
│ ├── dim_products.view.lkml # Product dimension
│ ├── dim_social_content.view.lkml # Social content dimension
│ ├── fact_customer_journey.view.lkml # Customer journey fact
│ ├── fact_data_quality.view.lkml # Data quality metrics
│ ├── fact_email_marketing.view.lkml # Email marketing fact
│ ├── fact_events.view.lkml # GA4 events fact
│ ├── fact_inventory.view.lkml # Inventory fact
│ ├── fact_marketing_performance.view.lkml # Marketing performance
│ ├── fact_order_items.view.lkml # Order items fact
│ ├── fact_orders.view.lkml # Orders fact
│ ├── fact_sessions.view.lkml # Web sessions fact
│ └── fact_social_posts.view.lkml # Social posts fact
└── dashboards/
├── executive_overview.dashboard.lookml
├── sales_orders_analytics.dashboard.lookml
└── data_quality_monitoring.dashboard.lookml
-
Fixed Data Type Issues:
- Updated
dim_date.date_actualfromdatetimetotimestampdatatype for consistency - Fixed DATE vs TIMESTAMP comparison errors in explores
- Updated
-
Dashboard Improvements:
- Fixed percentage formatting in Data Quality Monitoring dashboard (values now display correctly as 97.8% instead of 9778%)
- Added % suffix to all percentage metrics
- Updated conditional formatting thresholds for Average Pipeline Health metric
-
Model Enhancements:
- Added
attribution_analysisexplore as an alias forfact_customer_journey - Fixed marketing performance explore joins to use proper date conversions
- Included dashboard files in the model configuration
- Added
-
Dashboard Consolidation:
- Streamlined to 3 core dashboards from 4
- Removed separate marketing attribution dashboard (functionality integrated into other dashboards)
- Looker Instance: Access to a Looker instance (cloud or on-premise)
- BigQuery Connection: Configured connection named
ra_dw_prod - Permissions:
- Looker: Developer permissions
- BigQuery: Data Viewer access to the warehouse dataset
- Data Warehouse: Deployed Ra Ecommerce Data Warehouse v2 in BigQuery
In Looker:
- Navigate to Develop → Manage LookML Projects
- Click New LookML Project
- Name:
ecommerce_demo - Starting Point: "Blank Project"
# In your local development environment
cd /path/to/lookml/project
git init
git remote add origin <your-git-repo-url># Create directories
mkdir -p views models dashboards
# Copy all LookML files to appropriate directoriesIn Looker Admin:
- Go to Admin → Database → Connections
- Create or verify connection:
- Name:
ra_dw_prod - Dialect: Google BigQuery Standard SQL
- Project: Your GCP Project ID (e.g.,
ra-development) - Dataset:
analytics_ecommerce_ecommerce
- Name:
# Commit and deploy
git add .
git commit -m "Initial LookML project setup"
git push origin main
# In Looker
# Click "Deploy to Production"
# Run LookML ValidatorCentral time dimension for all date-based analysis:
Key Dimensions:
date_key: Primary key (YYYYMMDD format)date_actual: Full date with timeframes (now using timestamp datatype)fiscal_*: Fiscal calendar dimensionsis_weekend,is_holiday: Boolean flagsseason: Derived season based on month
Key Measures:
count: Number of datescount_days: Total days in period
Customer dimension with demographic and value attributes:
Key Dimensions:
customer_key: Surrogate keycustomer_id: Natural key from sourcecustomer_name: Full nameemail: Customer emailcustomer_type: New/returning classification
Key Measures:
count: Total customerscount_current: Active customers
Product catalog with categories and pricing:
Key Dimensions:
product_key: Surrogate keyproduct_id: SKU/product codeproduct_name: Product titleproduct_type: Category classificationproduct_status: Active/discontinued
Key Measures:
count: Total productsaverage_price: Mean product price
Granular order line item data:
Key Dimensions:
order_line_sk: Primary keyorder_size_category: Order value segmentationmargin_category: Profitability classificationis_high_value_order: Premium order flag
Key Measures:
total_revenue: Sales revenueaverage_order_value: AOVunits_per_order: Basket sizereturn_rate: Return/refund rate
Website behavior and conversion tracking:
Key Dimensions:
channel_grouping: Derived traffic channelsuser_type: New vs returningis_high_engagement: Quality session indicatordevice_category: Device segmentation
Key Measures:
engagement_rate: Session qualitybounce_rate: Single-page sessionsconversion_rate: Goal completionssessions_per_user: User frequency
Campaign and ad performance metrics:
Key Dimensions:
platform: Ad platformperformance_category: ROAS-based classificationspend_tier: Budget segmentationcampaign_duration_days: Campaign length
Key Measures:
overall_roas: Return on ad spendoverall_cpa: Cost per acquisitionoverall_ctr: Click-through ratetotal_engagement: Social interactions
Marketing channel taxonomy and attributes:
Key Dimensions:
channel_type: Paid/organic classificationperformance_tier: Quality scoringcac_efficiency: Acquisition cost efficiencysupports_*: Capability flags
Key Measures:
average_conversion_rate: Channel effectivenessaverage_cac: Acquisition costspremium_channels: High-value channel count
Pipeline monitoring and data quality:
Key Dimensions:
quality_tier: Test pass rate classificationhealth_status: Pipeline healthfreshness_status: Data recencyrequires_attention: Alert flag
Key Measures:
data_quality_score: Composite health metricoverall_test_pass_rate: Quality percentagesources_with_issues: Problem source counterror_rate: Error frequency
explore: orders {
join: order_date {...}
join: customers {...}
join: products {...}
}Use Cases: Sales analysis, product performance, customer purchase behavior
explore: customer_analytics {
sql_always_where: ${is_current} = true ;;
join: customer_orders {...}
}Use Cases: CLV analysis, segmentation, retention
explore: marketing_performance {
join: performance_date {...}
join: channels {...}
}Use Cases: ROAS analysis, campaign optimization, channel comparison
explore: website_analytics {
join: session_date {...}
}Use Cases: Traffic analysis, conversion optimization, user behavior
Combines multiple fact tables for C-level reporting with cross-functional metrics.
Advanced explore for multi-touch attribution with customer journey mapping.
All explores follow consistent patterns:
- Time joins: Always through date dimension
- Dimension joins: Via surrogate keys
- Cardinality: Properly defined relationships
- Field selection: Curated field lists to avoid confusion
The LookML project includes three comprehensive dashboards designed for different audiences and use cases.
Purpose: High-level business performance metrics and trends for C-level executives and senior management.
Key Visualizations:
-
Top KPI Row:
- Total Revenue (formatted as currency)
- Total Orders (count)
- Average Order Value
- Total Unique Customers
- Customer Acquisition Cost
- Return on Ad Spend (ROAS)
-
Revenue Trend: Line chart showing daily revenue over the selected period
-
Orders by Channel: Pie chart breaking down order distribution by marketing channel
-
Orders by Financial Status: Column chart showing paid, pending, and refunded orders
-
Marketing Spend vs Revenue: Dual-axis chart comparing marketing investment to revenue generated
-
Website Conversion Funnel: Funnel visualization showing sessions → add to cart → conversion rates
Filters:
- Date Range (default: 30 days)
- Uses the
executive_overviewexplore which combines data from orders, customers, marketing, and sessions
Refresh: Every 1 hour
Purpose: Detailed sales performance analysis for sales teams, product managers, and operations.
Key Visualizations:
-
Sales KPI Tiles:
- Total Revenue with YoY comparison
- Total Orders with trend
- Average Order Value
- Total Unique Customers
-
Sales Trend Analysis:
- Daily revenue and order count (dual-axis)
- 7-day moving average overlay
-
Product Performance:
- Top 10 products by revenue (horizontal bar chart)
- Product category breakdown
-
Customer Analytics:
- Orders by customer tier
- Customer concentration analysis
- New vs returning customer split
-
Geographic Distribution:
- Revenue by country/region
- Shipping vs billing location analysis
Filters:
- Date Range (default: 7 days)
- Product Category
- Customer Country
- Order Status
Refresh: Every 15 minutes
Purpose: Monitor data pipeline health, quality metrics, and identify data issues for data engineering and analytics teams.
Key Visualizations:
-
Quality Metrics Row:
- Overall Test Pass Rate (97.8% - with color coding)
- Average Pipeline Health (97.8% - green/yellow/red thresholds)
- Total Data Volume (row count across all layers)
- Sources with Issues (count with conditional formatting)
- Average Flow Efficiency (53.0% - data movement efficiency)
- Data Quality Score (97.7% - composite metric)
-
Pipeline Health Trend: Multi-line chart showing health metrics over time
-
Data Source Health Status: Stacked bar chart showing health status by data source
-
Data Flow Efficiency by Layer: Column chart showing efficiency percentages:
- Source to Staging flow
- Staging to Integration flow
- Integration to Warehouse flow
- End-to-end flow percentage
-
Data Volume by Source: Pie chart showing relative data volumes
-
Error and Warning Summary: Bar chart highlighting sources with quality issues
Filters:
- Date Range (default: 7 days)
- Data Source (multi-select)
- Data Layer (staging, integration, warehouse)
Refresh: Every 15 minutes
Note: All percentage values have been corrected to display properly (e.g., 97.8% instead of 9778%) with appropriate conditional formatting for visual alerts.
- Use Version Control: Always develop in a Git branch
- Test Thoroughly: Validate explores before deploying
- Document Changes: Update view descriptions
- Follow Naming Conventions:
- Views:
{layer}_{type}_{name} - Dimensions:
snake_case - Measures:
descriptive_names
- Views:
- Use Persistent Derived Tables for complex calculations
- Implement Datagroups for caching:
datagroup: nightly_refresh {
sql_trigger: SELECT CURRENT_DATE() ;;
max_cache_age: "24 hours"
}- Aggregate Awareness: Create aggregate tables for common queries
- Index Hints: Add BigQuery clustering hints in SQL
- Row-Level Security: Implement access filters
access_filter: {
field: customers.country
user_attribute: country
}- Field-Level Security: Use
hidden: yesfor sensitive fields - Model Permissions: Set appropriate model access
- Regular Validation: Run LookML validator weekly
- Usage Analytics: Monitor explore usage
- Performance Monitoring: Track query execution times
- Documentation Updates: Keep README current
- Validate LookML: No errors in validator
- Test All Explores: Verify data accuracy
- Check Permissions: Appropriate access controls
- Update Documentation: Current with changes
- Performance Test: Large date ranges
- Create Change Log: Document modifications
- Development Environment:
git checkout -b feature/new-analysis
# Make changes
lookml validate
git add .
git commit -m "Add new analysis"
git push origin feature/new-analysis-
Pull Request Review:
- Code review by team lead
- Test in Looker dev mode
- Validate against production data
-
Production Deployment:
- Merge to main branch
- Deploy to production in Looker
- Verify explores and dashboards
- Monitor for errors
If issues arise:
- Revert to previous commit in Git
- Deploy previous version in Looker
- Investigate issues in development
- Re-deploy after fixes
Add custom visualizations:
// In custom_visualizations/
looker.plugins.visualizations.add({
id: "custom_funnel",
label: "Custom Funnel",
options: {...}
})Access via Looker API:
# Python example
import looker_sdk
sdk = looker_sdk.init40()
look = sdk.run_look(look_id=123, result_format="json")Set up automated delivery:
- Create Look or Dashboard
- Set schedule (daily, weekly, monthly)
- Configure alerts for thresholds
- Set delivery format (PDF, CSV, Excel)
- "Unknown field" errors: Check view includes in model
- Join errors: Verify relationship cardinality
- Permission denied: Check connection credentials
- Slow queries: Review BigQuery execution plan
Enable SQL debugging:
# In model file
sql_trigger_value: SELECT 1 ;; # Forces cache refreshView generated SQL in Explore SQL tab.
- LookML Reference: https://docs.looker.com/reference/lookml-quick-reference
- BigQuery Optimization: Review clustering and partitioning
- Community Forum: Looker Community for best practices
- Internal Support: Contact your Looker administrator
Copyright © 2025 Rittman Analytics. All rights reserved.


