You run ads, spend budget, but sales aren't growing? You don't know which channel is profitable and which is draining money. We fix that — we set up end-to-end analytics that connects every ruble of ad spend to actual revenue. Within 2-3 weeks, you'll see the full picture: from click to deal. Without end-to-end analytics, you're managing blindly — we change that.
According to Wikipedia, end-to-end analytics is a method of measuring ad effectiveness that links costs to specific sales. In this article, we'll break down how end-to-end analytics works, what components are needed, and how we implement it. You'll learn how to combine data from ad platforms, CRM, and your website to track ROI per channel. Example: a B2B client reduced cost per lead by 35% after implementing end-to-end analytics by reallocating budget, saving about 250,000 ₽ per month.
Components of end-to-end analytics
- Ad spend tracker — pulls cost data from Yandex.Direct, Google Ads, VKontakte, Facebook via their APIs.
- Call tracking — replaces phone numbers with unique ones per source to track calls.
- CRM — stores deals with lead source attribution.
- BI/Dashboard — consolidates everything into a single table: spend → visits → leads → sales → revenue.
How to choose between Roistat and a custom implementation?
Roistat — a Russian end-to-end analytics platform. It's embedded via script, integrates with Yandex.Direct, Google Ads, amoCRM, Bitrix24. Suitable for most small/mid-size businesses. Custom analytics is needed when ready-made solutions don't cover your specifics or become too expensive at high volumes.
We often see: companies with high traffic (100,000+ visits per month) benefit from custom analytics because Roistat becomes costly. For smaller projects, Roistat is 2-3 times faster and cheaper.
| Feature | Roistat | Custom analytics |
|---|---|---|
| Setup speed | 1-2 weeks | 4-6 weeks |
| Cost | Depends on lead volume | One-time development |
| Customization | Limited | Full |
| Data control | Depends on platform | Full |
| Scalability | Up to 10,000 leads/month | Unlimited |
Why end-to-end analytics pays for itself in 1-2 months?
End-to-end analytics shows which channels generate real profit. For example, you might discover that context ads give ROAS of 8, while targeted ads only 2. By reallocating budget, you increase total revenue without extra spend. We guarantee a payback within 1-2 months based on experience with 50+ projects.
Key end-to-end analytics metrics
| Metric | Description | Formula |
|---|---|---|
| CPA | Cost per acquisition | Spend / Number of customers |
| ROAS | Return on ad spend | Revenue / Spend |
| LTV | Lifetime value | Average check × Purchase frequency × Lifetime |
| CR | Lead-to-deal conversion rate | Deals / Leads |
How is the technical implementation done?
Architecture of custom implementation
Ad systems (API)
→ ETL service (Python/Go)
→ Data storage (ClickHouse / PostgreSQL / BigQuery)
→ BI tool (Redash / Metabase / Superset)
→ Dashboard
Website (UTM + cookies)
→ Backend
→ Data storage
CRM
→ Data storage
Fetching data from ad systems
# Yandex.Direct: get spend for a period
import requests
headers = {'Authorization': f'Bearer {YANDEX_TOKEN}', 'Client-Login': CLIENT_LOGIN}
report_body = {
'params': {
'SelectionCriteria': {
'DateFrom': '2024-01-01', 'DateTo': '2024-01-31'
},
'FieldNames': ['Date', 'CampaignName', 'Impressions', 'Clicks', 'Cost'],
'ReportName': 'Cost Report',
'ReportType': 'CAMPAIGN_PERFORMANCE_REPORT',
'DateRangeType': 'CUSTOM_DATE',
'Format': 'TSV',
'IncludeVAT': 'YES'
}
}
response = requests.post(
'https://api.direct.yandex.com/json/v5/reports',
headers=headers,
json=report_body
)
Linking leads to ad source
-- Table to store sessions with UTM
CREATE TABLE sessions (
session_id UUID PRIMARY KEY,
user_id BIGINT REFERENCES users(id),
utm_source VARCHAR(100),
utm_medium VARCHAR(100),
utm_campaign VARCHAR(200),
referrer TEXT,
created_at TIMESTAMP
);
-- Leads linked to session
CREATE TABLE leads (
id BIGINT PRIMARY KEY,
session_id UUID REFERENCES sessions(session_id),
phone VARCHAR(20),
type VARCHAR(50), -- 'form' | 'call' | 'chat'
created_at TIMESTAMP
);
-- Orders linked to lead
CREATE TABLE orders (
id BIGINT PRIMARY KEY,
lead_id BIGINT REFERENCES leads(id),
total INTEGER,
status VARCHAR(20),
created_at TIMESTAMP
);
Main end-to-end analytics report
SELECT
s.utm_source,
s.utm_campaign,
COUNT(DISTINCT s.session_id) as visits,
COUNT(DISTINCT l.id) as leads,
COUNT(DISTINCT o.id) as orders,
SUM(o.total) / 100.0 as revenue,
SUM(rc.cost) / 100.0 as ad_spend,
ROUND(SUM(o.total) / NULLIF(SUM(rc.cost), 0), 2) as roas
FROM sessions s
LEFT JOIN leads l ON l.session_id = s.session_id
LEFT JOIN orders o ON o.lead_id = l.id AND o.status = 'completed'
LEFT JOIN ad_costs rc ON rc.utm_source = s.utm_source
AND rc.utm_campaign = s.utm_campaign
AND DATE_TRUNC('day', rc.date) = DATE_TRUNC('day', s.created_at)
WHERE s.created_at >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY s.utm_source, s.utm_campaign
ORDER BY revenue DESC NULLS LAST;
Call tracking in custom implementation
For call tracking, we integrate with Calltouch or CoMagic. They replace the phone number on the site based on traffic source. On call, they pass UTM parameters via webhook. Alternatively, custom call tracking via SIP provider: a pool of virtual numbers, each visitor gets a unique number from the pool.
Dashboard in Metabase
Metabase connects directly to PostgreSQL and builds dashboards without writing code. For non-technical marketers, it's the optimal choice.
Example ETL process
Data from ad systems is exported every hour, stored in ClickHouse, then transformed via dbt and fed into the dashboard.What our work includes?
- Audit of current ad accounts and CRM
- Integration of ad system APIs
- Call tracking setup (if needed)
- Development of ETL process for data collection
- Creation of dashboard with key metrics
- Documentation and training for your team
- Support for 30 days after launch
Process of work
- Analysis — study your ad structure, CRM, site.
- Design — choose architecture (platform or custom).
- Implementation — set up data collection, ETL, dashboard.
- Testing — verify data accuracy, adjust.
- Deployment — go live, hand over documentation.
Approximate timelines
- Ready-made solution: 1-2 weeks
- Custom analytics: 4-6 weeks
- Hybrid approach: 2-4 weeks
Contact us for a consultation — we'll evaluate your project and propose the optimal solution. Order end-to-end analytics setup and gain full control over your ad budget.







