RapidMetricsRapidMetrics

Ad Attribution Setup

RapidMetrics connects your Facebook ad clicks to actual purchases using unique ad identifiers. This guide covers both setup methods to ensure every sale is attributed to the correct campaign, ad set, and ad.

How Ad Attribution Works

  1. A visitor clicks your Facebook ad and lands on your funnel page.
  2. The tracking script captures the ad identifiers from the URL along with UTM parameters, IP address, and user agent.
  3. RapidMetrics stores the Campaign ID, Ad Set ID and Ad ID with the visit. With UTM mapping (Method 2), it looks up the Ad Set and Campaign from the ads your Chrome extension has synced.
  4. When the visitor purchases, the revenue is attributed to that specific ad, ad set, and campaign.
  5. You see exactly which ad generated the sale in Ad Attribution (left sidebar), where you click from a campaign into its ad sets and ads.
💡 RapidMetrics uses last-touch attribution: if a visitor clicks multiple ads before buying, the most recent visit gets the credit. The IDs must be numeric Facebook IDs like 120234323642610. A sale only counts toward a campaign, ad set or ad when the visit is tagged with that level's ID. Method 1 tags all three. Method 2 tags the ad, and fills in its Ad Set and Campaign when that ad is already synced.

Method 1: Custom rm_ Parameters (Recommended)

This is the preferred method. You add RapidMetrics-specific parameters to your Facebook ad URLs using Facebook's dynamic macros.

Step 1: Edit Your Ad URL

In Facebook Ads Manager, add these parameters to your destination URL or URL Parameters field:

rm_aid={{ad.id}}&rm_adsid={{adset.id}}&rm_cid={{campaign.id}}

Your full URL will look like:

https://yourfunnel.com/page?rm_aid={{ad.id}}&rm_adsid={{adset.id}}&rm_cid={{campaign.id}}

Step 2: Verify

Click your ad and check the landing page URL. You should see numeric IDs like:

?rm_aid=120234323642610&rm_adsid=120234323642456&rm_cid=120207174116789

That's it. RapidMetrics picks these up automatically. To see your campaigns, spend and ROAS in Ad Attribution, also sync your ad account with the RapidMetrics Chrome extension: see Syncing Facebook Ad Data via the RapidMetrics Chrome Extension.

💡 Keep all three parameters. When a visit carries only rm_aid, RapidMetrics does not fill in its Ad Set and Campaign, so the sale counts for the ad but not in its ad set and campaign totals.

Method 2: UTM Parameter Mapping

Use this method if you have long-running campaigns where changing the URL would trigger Facebook's re-learning phase. Instead of adding new rm_ parameters, you tell RapidMetrics which of your existing UTM parameters already contains the Ad ID.

When to Use UTM Mapping

  • Your ads already use UTM parameters with Facebook's dynamic macros (e.g., utm_content={{ad.id}}).
  • You don't want to modify your ad URLs because the campaigns have been running and are optimized.
  • You're migrating from another tracking tool that used UTMs for ad IDs.

Step 1: Check Your Existing URLs

Look at your current ad URLs in Facebook Ads Manager. A common setup looks like:

https://yourfunnel.com/page?utm_source=facebook&utm_medium={{adset.id}}&utm_content={{ad.id}}

Identify which UTM parameter contains your Ad ID. In this example, it's utm_content.

Step 2: Configure the Mapping

  1. Click your profile icon (top right) → Settings.
  2. Find the Ad ID Parameter section and keep Standard (UTM) selected.
  3. In UTM Parameter containing Ad ID, pick the UTM parameter that holds your ad ID (e.g., utm_content).
  4. To also fill in past visits, turn on Backfill existing sessions now (see Step 3).
  5. Click Save Workspace.
💡 The Ad ID is the only thing you map. When a visit arrives, RapidMetrics looks the ad up in the ads your Chrome extension has synced and fills in its Ad Set and Campaign for you. If the ad was not synced yet at the time of the visit, only its Ad ID is stored.

Step 3: Backfill Existing Sessions (Optional)

If you had visitors before setting up the mapping, you can retroactively apply it. Do it in the same save as Step 2: the backfill only runs when you save a new or changed Ad ID parameter. If you already saved the mapping earlier, set the dropdown to Not mapped, click Save Workspace, then pick your parameter again and follow these steps.

  1. After picking the parameter, turn on the Backfill existing sessions toggle. RapidMetrics first checks for synced Facebook ad data. If it finds none, it asks you to sync your ads with the Chrome extension first.
  2. Click Save Workspace.
  3. RapidMetrics will scan your existing sessions, find ones with valid Facebook Ad IDs in the mapped UTM field, and populate the ad tracking fields.

Validation & Data Quality

RapidMetrics validates all ad identifiers before storing them:

  • Only values that are numeric and at least 5 digits are accepted (matching Facebook's ID format).
  • Text values like campaign names or slugs are silently rejected.
  • This applies to both rm_ parameters and UTM-mapped values.

Priority Rules

If both rm_ parameters and UTM mapping are present:

  1. rm_ parameters always win: they take priority over UTM mapping.
  2. UTM mapping only kicks in when the URL has no valid rm_aid.

This means you can safely enable UTM mapping for older campaigns while using rm_ parameters for new ones. They won't conflict.

Troubleshooting

SymptomCauseFix
Ad Attribution shows spend but no purchasesMissing or invalid ad IDs in URLCheck that your URL contains rm_aid, rm_adsid and rm_cid, or a mapped UTM with a numeric Facebook ID
A sale counts for the ad but not for its ad set or campaignThe visit carried only the Ad ID, or (with UTM mapping) the ad was not synced yet when the visit happenedAdd rm_adsid and rm_cid to your ad URLs. With UTM mapping, keep the Chrome extension syncing (it syncs every 15 minutes, or click the sync icon, Sync now, on your job in the extension). Visits after the sync are filled in.
UTM mapping not workingUTM value is not a numeric Facebook IDVerify your Facebook ad URL uses {{ad.id}} macro, not a name
Backfill shows 0 updatesNo sessions have valid numeric IDs in the mapped UTM fieldCheck that the correct UTM field is mapped and that your ads actually use Facebook's dynamic ID macros
Next: Supported Facebook Events →

Learn more about Supported Facebook Events →

Last updated: September 28, 2026