Goal: Configure both server-side (CAPI) and client-side (App Events / JS SDK) Facebook integrations from scratch, including app creation, adding your Mobstep app package, linking hash keys, mapping events, testing, and deduplication.
Why use both?
Conversions API (CAPI): Server-side events improve attribution, recover signals blocked by ad-blockers, and are resilient to browser privacy limitations.
App Events / JS SDK: Client-side events give real-time UI tracking for PageView, ViewContent, AddToCart, Purchase, etc.
Best practice: Enable both + use deduplication (
event_id) so Meta doesn’t double-count events.
Prerequisites
Meta Business Manager access.
Access to Meta Events Manager for the Pixel.
Mobstep account with Application Builder access.
For App Events: a Meta App in developers.facebook.com.
Part A — Facebook App Creation and Setup (for App Events)
1) Create a new Facebook App
Go to developers.facebook.com → My Apps → Create App.
Choose Business app type → click Next.
Fill in:
App Name (e.g., Mobstep “MyApp”)
Contact Email
Business Account → select your Meta Business Manager account.
Click Create App.
Reference: Meta App Creation Guide
2) Add your Mobstep app to Facebook App
Open Application Builder in Mobstep → select your app → Keys tab:
Copy your Package Name.
Copy the Debug Key Hash and Release Key Hash (two keys).
In your Facebook App → Settings → Basic → Add Android App.
Paste Package Name from Mobstep.
Paste Debug and Release Key Hashes.
Save changes.
Why keys matter: Facebook SDK verifies your app’s signature when sending App Events from the client. Without matching hash keys, events may be rejected.
3) Copy your App ID and Client Token
In Settings → Basic, copy App ID.
Optional: copy Client Token for SDK validations (improves security).
4) Add products for App Events tracking
In your Facebook App → App Dashboard → Add Product → App Events.
Enable App Events → configure tracking.
These events will now correspond to Mobstep events (mapped via JSON later).
Reference: Meta App Events Guide
Part B — Facebook Pixel & Conversion API Setup
1) Create / select Pixel
Go to Events Manager → Data Sources → Pixels → Add or select an existing Pixel.
Copy Pixel ID for Mobstep configuration.
2) Generate Conversion API Access Token
In Pixel → Settings → Conversions API → Generate Access Token.
Copy token — you’ll paste it into Mobstep.
3) (Optional) Get Test Event Code
Pixel → Test Events → copy Test Event Code for temporary testing.
Part C — Mobstep Plugin Setup
1) Facebook Conversion API (server-side)
Go to your app → Plugins → Facebook Conversion API.
Toggle Enable Facebook Conversion API.
Paste Pixel ID and Access Token.
Optional: paste Test Event Code.
Keep Send Events ON.
Add Event Mapping JSON (example below).
Toggle Deduplication Enabled if you’re also sending App Events.
Save.
2) Facebook App Events (client-side JS SDK)
Go to Plugins → Facebook App Events.
Toggle Enable Facebook App Events.
Paste App ID and optional Client Token.
Keep Tracking Enabled ON.
Add Event Mapping JSON (can mirror CAPI mapping).
Save.
Part D — Testing
1) Test Events in Events Manager
Paste Test Event Code (CAPI).
Trigger flows: view product, add to cart, purchase.
Verify Browser (App Events) and Server (CAPI) streams.
2) Verify deduplication
Confirm
event_idmatches across browser + server events.
3) Use Meta Payload Helper for CAPI payload validation
Check currency, numeric fields, required identifiers.
Part E — Privacy & Compliance
Collect and honor user consent (GDPR / CCPA).
Don’t send raw PII unless hashed/allowed.
Troubleshooting
| Issue | Fix |
|---|---|
| No events | Check plugin enabled, Pixel/App ID correct, Access Token valid. |
| Duplicates | Enable deduplication + use same event_id. |
| Server events missing | Ensure Send Events ON, server can reach Meta. |
| App Events missing | Check Tracking Enabled, hash keys match Mobstep app. |
Final Checklist
Meta: Pixel ID, CAPI Access Token, optional Test Event Code.
Facebook App: App ID, optional Client Token, hash keys added, package name correct.
Mobstep → Plugins → CAPI: Enabled, Event Mapping, Deduplication ON.
Mobstep → Plugins → App Events: Enabled, Tracking Enabled, Event Mapping.
Test in Events Manager → confirm Browser + Server events.