Cases/Horoshop ↔ Google Sheets integration for accurate ROAS
Automation · ROAS analytics

Horoshop ↔ Google Sheets integration for accurate ROAS

Matching Horoshop orders with Meta Ads campaigns for real ad profitability: spend, taxes, CPA, average order value, and ROAS per campaign — accurate to about 98%.

The challenge

Standard analytics weren't enough for ad decisions. We needed to match orders with ad campaigns, pull in UTM tags, reconcile them with the actual Meta Ads structure, calculate ROAS accounting for spend and taxes, and understand which campaigns drive real sales rather than just clicks or good-looking ad-manager numbers.

About the project
Format
ROAS analytics
Data source
Horoshop + Meta Ads
Processing
Google Sheets + Apps Script
Accuracy
about 98%
What we did

How the integration was built

01

Set up authorization with the Horoshop API.

02

Created a workflow for a historical order export starting 2026-01-01.

03

Created a daily workflow that automatically pulls new orders from the previous day.

04

Set up mapping of order fields, UTM tags, and ad parameters.

05

We pass the data into Google Sheets for further analysis.

06

Connected an Apps Script that calls the Meta Ads API and pulls campaigns, ad sets, ads, spend, statuses, budgets, and UTM from creatives.

07

Added custom matching of Horoshop orders with actual Meta Ads campaigns.

08

Set up several matching levels: by Meta ID from UTM, by campaign/ad set/ad ID, by campaign/ad set/ad names, by UTM from creatives, and fallback logic for ambiguous cases.

09

Based on this data we calculate ROAS, CPA, revenue, order count, spend, taxes, average order value, and average check.

10

Added a separate sheet for unmatched Meta paid orders to spot gaps in UTM tagging and improve analytics accuracy.

How it works

How the integration works

The path of an order from Horoshop to a real ad-profitability calculation.

01

Scheduled run

n8n runs the scenario on a daily schedule.

02

Authorization

The workflow authorizes with the Horoshop API.

03

Orders + UTM

Pulls orders for the needed period along with UTM tags.

04

Splitting records

Splits orders into individual records.

05

Structuring

Transforms the data into the required structure.

06

Google Sheets

Writes the result into Google Sheets.

07

Meta Ads data

Apps Script pulls actual Meta Ads data on campaigns, ad sets, ads, statuses, budgets, and spend.

08

Matching

The script matches orders with ad campaigns by UTM, Meta ID, campaign/ad set/ad names, and creative UTM parameters.

09

Efficiency calc

The sheet calculates ad efficiency by campaign, ad set, and creative.

10

Unmatched orders

A separate list of unmatched orders is built so the team can see where to fix UTM tagging or campaign structure.

Daily workflow for exporting Horoshop orders.
N8NDaily workflow for exporting Horoshop orders.
Matching orders with Meta Ads campaigns by UTM and Meta ID.
APPS SCRIPTMatching orders with Meta Ads campaigns by UTM and Meta ID.
Proof
Google Sheets ROAS calculation table
GOOGLE SHEETSROAS, CPA, spend, tax, and average-check calculations per ad group.
Management takeaway example

In May, the strongest scaling candidate was the campaign with ROAS 2.03 and CPA 649 UAH. Campaigns with ROAS 0.64 and 0.69 were not scaled directly and were treated as sources of hypotheses for creative and audience tests.

The result
  • Meta paid order matching quality for May: 178 out of 181.
  • Order coverage: 98.34%. Revenue coverage: 98.86%.
  • The team sees which campaigns actually generate purchases.
  • Real Meta Ads costs are visible with conversion into UAH.
  • Taxes are included in the report, so ROAS and CPA are closer to the real business economics.
  • The report shows orders, revenue, spend, ROAS, CPA, average purchase value, and average check by campaign, ad set, and ad.
  • The ad budget can be scaled based on actual revenue, not assumptions.
  • Weak campaigns are not scaled and remain under control or go into targeted tests.
Technologies
Horoshop APIn8nGoogle SheetsGoogle Apps ScriptMeta Ads APIUTM analyticsROAS/CPA formulasMeta ID matching
Short case summary

The Horoshop, Google Sheets, Apps Script, and Meta Ads API integration extracts order UTM data, matches it with actual Meta Ads campaigns, and calculates real ad profitability at about 98% accuracy — spend, taxes, orders, CPA, average check, and ROAS.

Client review

We finally see not only spend and orders, but real return by campaign. That helps us scale strong links and keep weak ones under control.

Ho
Horoshop project team
Client