Introduction
Ad Performance Analytics closes the create → publish → measure loop. Connect your Meta, Google Ads and TikTok ad accounts, pull spend, conversions and revenue into one unified cockpit, and attribute that performance back to the specific creatives you generated inside MagicAds. Unlike the generation studios, this plugin doesn’t create or publish anything — it reads reporting data from the ad networks and matches it to your creatives. Connecting accounts, syncing and every dashboard are free; the only credit-metered action is generating an AI performance analysis.What it adds
- Overview — a unified cockpit: headline KPIs with period-over-period deltas, a spend-vs-revenue trend with per-day ROAS, a by-network breakdown, budget pacing and fatigue alerts.
- Creatives — a creative-level ROAS leaderboard that ranks the creatives you generated in MagicAds by real ad performance, with a top-performer spotlight, attribution coverage meter and manual ad-to-creative linker.
- Campaigns — every campaign across all networks, rolled up and ranked, with a budget-share bar and color-coded ROAS.
- AI Insights — on-demand, credit-metered AI analysis: a headline verdict, health read, wins, watch-outs and prioritized recommendations.
- Connections — connect / pause / sync / disconnect ad accounts per network, with encrypted tokens and live sync status.
- Admin config — per-provider API credentials, feature + free-tier switches, and AI insight pricing.
Supported networks
How measurement works
Understanding the flow prevents the most common confusion.- You generate creatives in MagicAds (Image Studio, Video Studio, etc.). They live in your creative library.
- A user runs a creative as a paid ad on Meta, Google or TikTok — this happens in those platforms’ ad managers, not in MagicAds. MagicAds does not launch paid campaigns for you.
- The plugin syncs the ad’s daily metrics from the network’s reporting API.
- Attribution links each external ad back to the MagicAds creative that produced it, so the Creatives leaderboard can show ROAS per generated creative.
- Manual linking (always works) — on the Creatives screen a user links a spending ad to the creative it came from, using a visual picker.
- Tag matching (optional) — if the user names their ad, or sets the landing-page
utm_content, to include amagicads_<creativeId>token, the sync auto-links it. The creative id is the number shown on each creative.
Installation
Ad Performance Analytics is distributed through the in-app plugin marketplace — purchasing and installation both happen inside your MagicAds admin.Open the Plugins marketplace
Install / activate
- Already owned → installs directly.
- Not yet purchased → routes you to the plugin checkout to complete the purchase, then installs.
Configure the AI insights key
The dashboards, sync and attribution need no AI key. Only the AI Insights screen calls OpenAI, and it reuses the platform’s central, encrypted key store.Open AI Settings
/app/admin/ai).Add your OpenAI key
gpt-4o-mini) and a funded balance. Save.Register the ad-network apps
This is the one-time setup that lets your users connect. You’ll create a developer app on each network, whitelist the plugin’s callback URL, and paste the resulting credentials into the plugin config. First, get your exact callback URLs. Open Admin → General Settings → Plugins → Ad Performance Analytics — each provider block shows a read-only “Redirect / Callback URL” field. They follow this pattern (replace the domain with your site):Meta Ads (Facebook / Instagram)
Create a Meta app
Add the Marketing API
Add Facebook Login for OAuth
Copy the credentials
Request permissions & verify the business
Save into MagicAds
Google Ads
Google is the most involved because it needs both an OAuth client and a developer token.Create a Google Cloud project & OAuth consent screen
https://www.googleapis.com/auth/adwords. Add yourself as a test user (or publish the consent screen).Create an OAuth client ID
Get a Google Ads developer token
Note your Manager (MCC) ID (optional)
123-456-7890 number). This becomes the login-customer-id.Save into MagicAds
TikTok Ads
Create a TikTok for Business developer app
Set the redirect URI & scope
Submit for approval
Copy the credentials
Save into MagicAds
Configure the plugin
Go to Admin → General Settings → Plugins → Ad Performance Analytics (/app/admin/general/plugins/ad-analytics).
General
Per-provider credentials
One block each for Meta Ads, Google Ads and TikTok Ads, each with an enable switch, its credential fields, a setup hint, a docs link, and the read-only callback URL to whitelist. Click Save to persist all sections.Grant access by plan
Access is gated in two layers. Layer 1 — platform. The master Enable Ad Performance Analytics switch must be on. If not, the plugin is hidden for everyone. Layer 2 — the user. Given the platform layer is on:- Subscribed users (on a plan): governed by the plan’s Ad Performance Analytics feature toggle. Edit each plan and enable it where it should be included.
- Non-subscribed users (no plan): access only when both Enable Ad Performance Analytics and Free Tier Access are on.
Enable the sync cron
Syncing is cron-driven, so it runs on shared hosting and VPS alike. The host only needs Laravel’s single scheduler entry:- Hourly — queues a metrics sync for every active ad account whose throttle window has passed.
- Daily (03:30) — prunes normalized rows older than the retention window.
Go-live checklist
Install the plugin
Register at least one network app
Save the credentials
Add an OpenAI key (optional)
Set pricing & enable the feature
Grant plan access
Confirm the cron
php artisan schedule:run runs every minute on the host.Verify as a user
What your users do
This is the part to communicate clearly to your customers. Users never enter API keys — the developer apps you registered are the “application”; your users only need to authorize their own ad accounts through them.Connect an account
Sync
Link creatives (for creative-level ROAS)
utm_content to include the magicads_<id> code (auto-links on sync), or with the manual visual picker.- An ad account on the network with admin or analyst access (so the OAuth consent can grant read access).
- Live or historical campaigns — the plugin reads what exists; it does not create campaigns.
- For TikTok revenue/ROAS: revenue is opt-in because the metric name depends on the advertiser’s attribution setup. Spend, clicks, impressions and conversions always import; to enable TikTok ROAS, set
ad-analytics.providers.tiktok.value_metricin the config file to the revenue metric your advertiser reports support.
Using the screens
All screens live under Analytics → Ad Analytics in the user sidebar and share a header with a date-range control (7d / 30d / 90d / MTD), a network filter, a live KPI strip and a Sync now button.Overview
The cockpit. Headline KPI cards (Spend, ROAS, Revenue, Conversions, CTR, CPA) each show a period-over-period delta. Below them: a Spend vs. Revenue area chart whose tooltip also shows that day’s ROAS; a By network breakdown with brand-colored bars, ROAS and budget share; Budget pacing (month-to-date spend and a run-rate projection); and Fatigue alerts flagging ads whose CTR is sliding week-over-week.Campaigns
Every campaign across all networks as a card: network icon, color-coded ROAS pill, a five-metric grid (Spend, Revenue, Conversions, CTR, CPA) and a budget-share bar. Sort by any metric; filter by network and date range.Creatives
The signature screen — creative-level ROAS. An attribution coverage meter shows how much spend is linked. The leaderboard spotlights your top performer and grids the rest, each card showing the creative thumbnail, color-coded ROAS, key metrics and the network(s) it ran on. Below, Link ads to creatives lists spending ads that aren’t linked yet; the visual picker lets you match each to a generated creative. Existing links show as removable chips.AI Insights
Generate an on-demand analysis for the current range and network filter. Each report includes a headline verdict, an overall health badge, “what’s working” and “watch outs” lists, and prioritized recommendations tagged by category (budget, creative, targeting, bidding, attribution, scaling, testing), impact, effort, target entity and expected effect. Reports are cached in history so a paid generation is never repeated. Generating costs the configured credit rate and is charged only on success.Connections
Add accounts per network (one-click OAuth), then pause, sync or disconnect each. Cards show status, currency, last-synced time and any sync error.Billing
- The only billable action is generating an AI insight — charged the flat rate set in the config (default 3 credits).
- Users are only charged on success — a failed AI call costs nothing.
- Credits are deducted atomically, drawing from
creditsthencredits_prepaid, so concurrent actions can’t overdraw. - Connecting accounts, syncing, and every dashboard are always free.
Troubleshooting
APP_KEY, metric data is pruned to the configured retention window, and credits are never deducted for failed AI generations.
