The DataLens Blog

Why your ad numbers don't match — explained plainly

Plain-English answers to the reporting questions every marketer asks: why platforms disagree, which number to trust, and what to do next. No SQL needed to start.

Latest Articles

Metric Discrepancies & Attribution9 min readSome SQL

Your GA4 Numbers Don't Match Your Ad Platform. Here's the Decision Tree

A step-by-step way to figure out which discrepancy you're looking at — attribution window, sampling, or a broken tag — before you file a bug report.

Sep 10, 2026Read article
Metric Discrepancies & Attribution6 min readNo code

Conversion Lag: Why Yesterday's ROAS Is a Lie Until Thursday

Same-day and next-day conversion numbers are provisional, not final. Here is how much they typically move, and how to report on them honestly.

Sep 10, 2026Read article
Databases & Query Optimization10 min readDeep dive

The GA4 Database Export Schema, Explained Field by Field for Marketers

A marketer's guide to GA4 export's nested table structure — what event_params actually holds, and how to query it without a data engineering background.

Sep 10, 2026Read article
Databases & Query Optimization8 min readSome SQL

Partitioning and Clustering, Explained With One Marketing Table

Walk through what partitioning and clustering actually do to a query, using a single GA4-style events table as the running example.

Sep 10, 2026Read article
Databases & Query Optimization7 min readSome SQL

Google Ads Data Transfer vs. the API: Which One Your Reporting Should Use

Two ways to get Google Ads data into BigQuery, with very different freshness, cost and maintenance tradeoffs. A practical comparison for choosing one.

Sep 10, 2026Read article
Metric Explainers6 min readNo code

Blended CAC vs. Channel CAC — Which One Goes to the Board?

Channel-reported CAC is almost always cheaper than blended CAC, and both numbers are correct. Here's how to know which one belongs in which conversation.

Sep 10, 2026Read article
Metric Explainers6 min readSome SQL

MER Explained, With the SQL

Marketing Efficiency Ratio sidesteps attribution disagreements entirely. Here's the formula, a worked example, and the query that computes it from a warehouse.

Sep 10, 2026Read article
Metric Explainers8 min readSome SQL

Attribution Windows: 1-Day Click, 7-Day View, and Why Your Numbers Moved

Every ad platform ships a different default attribution window. Here is what each window setting actually changes, with worked examples.

Sep 10, 2026Read article
Metric Explainers9 min readSome SQL

Incrementality vs. Last-Click for Teams Without a Data Scientist

A holdout test is the only way to know an ad's true causal effect. Here is a lightweight version any team can run without a dedicated experimentation function.

Sep 10, 2026Read article
Metric Explainers6 min readNo code

LTV:CAC Is a Ratio, Not a Target — How to Read It Honestly

A 5:1 LTV:CAC ratio means very different things depending on payback time. How to read the ratio alongside the number that actually matters.

Sep 10, 2026Read article
AI + Analytics7 min readSome SQL

Text-to-SQL Isn't the Hard Part — Schema Context Is

Writing correct SQL syntax is the easy 20%. Knowing which of five tables holds "revenue" and how they join is the part that actually determines whether the answer is right.

Sep 10, 2026Read article
AI + Analytics5 min readSome SQL

How to Audit an AI-Generated Query in 60 Seconds

A fast checklist for scanning any AI-written SQL query before you trust its output — the joins, the filters, and the aggregation, in that order.

Sep 10, 2026Read article
AI + Analytics5 min readNo code

Why Every DataLens Answer Ships Its SQL

A product philosophy note: why we decided a number without its query attached isn't a trustworthy number, and what that decision costs us.

Sep 10, 2026Read article
AI + Analytics5 min readNo code

Bring Your Own API Key: What That Actually Means for Your Data

DataLens lets you connect your own model provider key instead of routing through ours. Here is what that changes about where your data goes.

Sep 10, 2026Read article
Metric Discrepancies & Attribution10 min readSome SQL

Click IDs Are the Real Attribution Key: GCLID, FBCLID, WBRAID and Server-Side Tracking

Every attribution argument rests on a query parameter in the landing URL. What each click ID is, the five places it dies, and the two server-side systems that recover it.

Sep 6, 2026Read article
Metric Discrepancies & Attribution10 min readSome SQL

Offline Conversion Imports: Teaching Google and Meta What Money Looks Like

The pixel sees the lead; the CRM sees the money ninety days later. What to send back, how matching works, and the mistakes that make imports harmful.

Sep 6, 2026Read article
Metric Discrepancies & Attribution11 min readSome SQL

ATT, SKAN and the Privacy Sandbox: Why Your Dashboards Changed and What Works Now

Apple removed the identifier and Google is following. What ATT, SKAN and the Sandbox did to measurement, why dashboards look worse, and the stack that works on top.

Sep 6, 2026Read article
Databases & Query Optimization10 min readDeep dive

One Currency, One Timezone: Normalising Multi-Account Reporting Before It Lies to You

USD and INR spend in one column, UTC and account-timezone days in one join. The exchange-rate table, the convert-then-truncate rule, and the view every report should read.

Sep 6, 2026Read article
Databases & Query Optimization11 min readDeep dive

Why Your Revenue Doubled Overnight: Deduplicating Orders and Events in SQL

Ingestion doubles, fan-out joins and grain confusion multiply rows three different ways. The diagnostics that catch each and the dedup views that prevent them.

Sep 6, 2026Read article
Databases & Query Optimization10 min readDeep dive

Stale Dashboards Lie Confidently: Freshness Checks That Catch a Broken Pipeline First

A credential expired and the Monday review debated a demand collapse that never happened. Three layers of scheduled validation queries — freshness, shape, reconciliation.

Sep 6, 2026Read article
Metric Explainers10 min readSome SQL

Breakeven ROAS From First Principles: Margin, Fees, Shipping and the Floor Under Every Target

One division sets the floor beneath every target you will ever set. Deriving breakeven from the full variable stack and running it as a bidding guardrail.

Sep 6, 2026Read article
Metric Explainers11 min readSome SQL

Cohort Payback Curves: Why Month-0 ROAS Misleads Repeat-Purchase Brands

Snapshot metrics judge a movie by its first frame. Grouping customers by acquisition vintage, reading payback as a crossing point, and separating acquisition from retention.

Sep 6, 2026Read article
Metric Explainers10 min readSome SQL

Discount-Adjusted Metrics: How Sale Events Inflate ROAS While Destroying Contribution

Revenue triples and profit misses anyway. Margin compression, pull-forward holes and price-anchor erosion — and the reporting that prices each sale honestly.

Sep 6, 2026Read article
AI + Analytics9 min readSome SQL

Benchmarking an AI Analyst on Your Own 20 Golden Questions

Fluency is not accuracy and demos are not decisions. Building a verified question-SQL-answer suite that scores models, prompts and schema changes.

Sep 6, 2026Read article
AI + Analytics10 min readSome SQL

Anomaly Alerts That Do Not Spam: Static Thresholds vs Dynamic Baselines

Every false alarm trains readers to ignore the real one. Respecting data maturity, expecting seasonality, and the severity ladder that keeps channels trusted.

Sep 6, 2026Read article
AI + Analytics10 min readSome SQL

Least-Privilege Data Access for AI Tools: Views, Redaction, Row Limits

Exposing everything is a privacy surface and an accuracy problem at once. The analyst views, tokenisation and caps that narrow the world and improve the answers.

Sep 6, 2026Read article
Campaign Diagnostics & Optimization9 min readSome SQL

Budget Pacing Mid-Flight: Reading Spend-vs-Plan Before the Month Ends

Prorated expectations, partial-day honesty and the intraday trap: how to tell on the 12th whether you will overspend, underspend or land exactly on plan.

Sep 6, 2026Read article
Campaign Diagnostics & Optimization10 min readSome SQL

Creative Fatigue vs Audience Saturation: Telling Them Apart Before You Spend More

Frequency plus reach plus CPM decompose every scaling stall into its true cause. New creative fixes one of them; only a wider audience fixes the other.

Sep 6, 2026Read article
Campaign Diagnostics & Optimization10 min readSome SQL

Search-Term Mining: The Weekly Query That Pays for Itself

The search terms report is a list of customers telling you what they wanted in their own words. The 30-minute weekly routine that converts it into negatives and new keywords.

Sep 6, 2026Read article
Campaign Diagnostics & Optimization9 min readSome SQL

Impression-Share Autopsy: Lost to Budget vs Lost to Rank

Two loss columns prescribe opposite fixes: one wants money, the other wants better bids, quality or creative. Reading the split before spending a rupee more.

Sep 6, 2026Read article
Campaign Diagnostics & Optimization10 min readSome SQL

Geo Waste: The Pincodes Your Budget Should Never Have Visited

Delivery failures, COD refusal and serviceability gaps make some geographies structurally unprofitable. Overlaying RTO on geo performance finds the exclusion list.

Sep 6, 2026Read article
Campaign Diagnostics & Optimization9 min readSome SQL

Change-History Forensics: What Broke the Campaign Last Tuesday

Performance breaks have authors: edits, budget moves, auction shifts. Correlating the change log with the break before touching anything else.

Sep 6, 2026Read article
Metric Discrepancies & Attribution10 min readSome SQL

Why Shopify, GA4 and Meta Report Three Different Revenue Numbers for the Same Day

Three systems, one day, three revenue totals — and none of them is broken. Timezones, refunds, tax and shipping explain most of the gap. Here is how to decompose it line by line.

Aug 28, 2026Read article
Metric Discrepancies & Attribution9 min readSome SQL

Self-Reported Attribution vs. Your Pixel: What "How Did You Hear About Us?" Is Actually Good For

A post-purchase survey will never reconcile with your pixel, and it was never supposed to. Here is the question it does answer, and how to weight the answer without fooling yourself.

Aug 28, 2026Read article
Metric Discrepancies & Attribution10 min readSome SQL

UTM Governance: A Naming Convention That Survives Three Agencies

Most UTM schemes die the first time someone else touches them. A convention, a validator query, and the four rules that keep a taxonomy intact across agency handovers.

Aug 28, 2026Read article
Metric Discrepancies & Attribution9 min readSome SQL

Modeled Conversions: What Google and Meta Are Filling In for You

A share of the conversions in your ad dashboard were never observed — they were estimated. What modeling is, why it exists, and how to report a number that is part measurement and part inference.

Aug 28, 2026Read article
Databases & Query Optimization11 min readDeep dive

Your First 10 BigQuery Cost Guardrails — Before the Bill, Not After

Ten controls you can put in place in an afternoon, ordered by how much they save per hour of effort. Custom quotas, maximum bytes billed, partition requirements, and the ones people skip.

Aug 28, 2026Read article
Databases & Query Optimization11 min readDeep dive

Incremental Models Without dbt: Scheduled Queries That Don't Re-Scan the Year

You do not need a transformation framework to stop rebuilding a rolling table from scratch every morning. MERGE, a watermark, and a late-arriving-data window — in plain scheduled SQL.

Aug 28, 2026Read article
Databases & Query Optimization11 min readDeep dive

Joining Ad Spend to Orders When There's No Common Key

Campaign-level spend and row-level orders share no id. Here are the three join grains that actually work, the fan-out bug that ruins the naive version, and the SQL for each.

Aug 28, 2026Read article
Databases & Query Optimization10 min readDeep dive

Postgres vs. a Warehouse for Marketing Reporting: When to Stop Querying Prod

Your production database can carry marketing reporting further than most people assume — and then it cannot. The four signals that mean it is time, and the cheapest thing to do next.

Aug 28, 2026Read article
Metric Explainers11 min readSome SQL

Contribution-Margin ROAS: The Only ROAS That Survives a CFO Review

Revenue ROAS answers a question finance never asked. Here is how to rebuild it on contribution margin — with the cost lines people forget, and the SQL that computes it.

Aug 28, 2026Read article
Metric Explainers10 min readSome SQL

New vs. Returning Customer ROAS, and Why Blended Hides an Acquisition Problem

A stable blended ROAS can conceal acquisition falling apart underneath it. Split the numerator by customer type and the trend you actually need to see appears.

Aug 28, 2026Read article
Metric Explainers10 min readSome SQL

Payback Period vs. LTV:CAC — Which One Actually Gates Your Ad Budget

LTV:CAC tells you whether a customer is worth acquiring. Payback tells you whether you can afford to acquire them this quarter. Only one of those is a budget constraint.

Aug 28, 2026Read article
Metric Explainers12 min readSome SQL

RTO and COD in Indian D2C: Your ROAS Is Wrong Until Delivery Confirms

A cash-on-delivery order is a promise, not revenue. With RTO rates running 15-35%, order-time ROAS overstates reality by a third — here is how to measure delivered ROAS instead.

Aug 28, 2026Read article
Metric Explainers10 min readSome SQL

Frequency, Reach and Saturation: Reading the Curve Before You Scale Spend

Scaling spend inside a finite audience buys frequency, not reach. How to read the three curves together, and the diagnostic that tells you which wall you have hit.

Aug 28, 2026Read article
AI + Analytics11 min readSome SQL

What an AI Analyst Can't Do Yet — an Honest List

Eight things an AI analyst genuinely cannot do, written by someone building one. Where the ceiling is, why it is there, and which limits are shrinking.

Aug 28, 2026Read article
AI + Analytics10 min readSome SQL

Semantic Layers vs. Prompting: Where Business Definitions Should Live

You can put "active customer means ordered in 90 days" in a prompt, or in a semantic layer. One of those is a definition; the other is a suggestion.

Aug 28, 2026Read article
AI + Analytics11 min readDeep dive

How We Keep an LLM From Inventing a Column Name

A model that has never seen your schema will guess `order_total` and be wrong. The four layers — retrieval, constrained context, dry-run validation, repair — that stop it shipping.

Aug 28, 2026Read article
AI + Analytics10 min readDeep dive

The Real Cost of an AI Analytics Question: Tokens, Query Bytes, and What Drives the Bill

Two costs stack on every AI-generated answer, and the smaller one gets all the attention. A line-by-line breakdown of where the money actually goes.

Aug 28, 2026Read article
AI + Analytics9 min readSome SQL

Scheduled AI Reports vs. Dashboards: When a Daily Narrative Beats a Chart

A dashboard waits to be opened. A scheduled narrative arrives whether or not anyone was looking. Which failure mode each one has, and how to pick.

Aug 28, 2026Read article
Metric Discrepancies & Attribution9 min readSome SQL

Why Your ROAS in Google Ads Never Matches Your ROAS in Your CRM / Backend Database

Google Ads, Meta, and your CRM or backend database each attribute revenue differently. Here is exactly why the numbers disagree, and how to reconcile them without picking one to trust blindly.

Aug 26, 2026Read article
Databases & Query Optimization9 min readSome SQL

How to Read Database Query Plans and Stop the $400 Surprise Bill

Cloud databases and warehouses bill by data scanned and compute used, not rows returned. Here is how to inspect query estimates before running, and the three habits that cut query costs 10-100x.

Aug 26, 2026Read article
AI + Analytics8 min readSome SQL

Seven Questions to Ask Before You Trust an AI's Answer About Your Data

A syntactically valid query can still answer the wrong question. Seven concrete checks to run before you act on a number an AI gave you.

Aug 26, 2026Read article