setono/meta-conversions-api-php-sdk
PHP SDK for the Meta Conversions API that lets you send server-side conversion events to Meta/Facebook with typed requests, event models, and a simple client for integrating online and offline conversions into PHP or Laravel apps.
Fbc, Fbp, and the User object that carries them) exist to propagate Meta's click and browser IDs correctly. Match quality — and therefore reported ROAS — depends on getting these right, so this supports a roadmap item like "improve event match quality" rather than being a purely technical choice.User carries hashed identifiers and cookie values, adopting this package forces an explicit decision on what customer data leaves your infrastructure, under what consent state, and with what hashing. That is a compliance product decision, not an engineering one.Adopt when:
Fbp::$randomNumber is now private (so mutation must go through withRandomNumber()), User::$fbc/$fbp are typed Fbc|string|null, and Fb::withCreationTime() accepts int|\DateTimeInterface natively. That is a genuine correctness improvement for data that directly affects attribution.UPGRADE-2.0.md.Look elsewhere or wait when:
withCreationTime() now throws \TypeError rather than InvalidArgumentException — a TypeError does not implement ExceptionInterface, so generic catch blocks around this call will behave differently. Anything touching your error-handling or retry logic is not settled.For executives: This is a small, focused library that lets our backend report conversions directly to Meta, recovering measurement signal we lose to ad blockers, tracking prevention, and iOS restrictions. It is not a platform commitment — it is a few hundred lines of glue code behind an interface we control, and it can be swapped for Meta's official SDK or an in-house client without changing our product. The current release is a beta, so the recommendation is a scoped pilot on one pixel and one non-critical event, with full rollout gated on the stable 2.0 release. No customer-facing surface changes; the main decision it forces is a deliberate one about what customer data we send and under what consent.
For engineering: It is framework-agnostic and dependency-light — PHP 8.1+, PSR-18 client, PSR-17 factories. Integration in Laravel is a service provider plus a thin adapter around our existing HTTP client. This release is a cleanup: value objects are now properly immutable and natively typed, which removes a class of silent data-corruption bugs in the identifiers that drive attribution. Two things to plan around: (1) the beta.2 → beta.3 changes are near-zero for us, but the 1.x → 2.0 upgrade is documented separately and should be read before we pin a version; (2) the multi-pixel failure mode — the client throws at the first rejecting pixel and does not attempt the rest — means our adapter must fan out per pixel and aggregate outcomes rather than catching-and-logging at the top level. Pin to an exact beta, run the pilot, and revisit on 2.0.0 stable.
How can I help you explore Laravel packages today?