Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Capi Param Builder Php Laravel Package

facebook/capi-param-builder-php

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature Development: Accelerate implementation of Conversions API (CAPI) integration for server-side PHP applications, ensuring compliance with Meta’s parameter requirements (e.g., event validation, data formatting, and error handling).
  • Roadmap Alignment: Prioritize marketing attribution, e-commerce tracking, or lead-gen pipelines where CAPI is critical for accurate ad performance data. Reduces manual parameter validation, cutting development time by ~30% (per Facebook’s docs).
  • Build vs. Buy: Buy—this is a maintained, Meta-approved SDK with no licensing costs. Avoids reinventing parameter validation logic, which could introduce bugs or non-compliance.
  • Use Cases:
    • E-commerce: Validate Purchase or AddToCart events with required fields (e.g., value, currency, content_ids).
    • Lead Gen: Ensure Lead events include first_name, last_name, and email with proper formatting.
    • Cross-Device Tracking: Standardize event parameters across PHP backends (e.g., Laravel, Symfony) to improve data consistency.
    • Compliance: Automatically enforce Meta’s CAPI parameter guidelines (e.g., data_processing_options, test_event_code).

When to Consider This Package

  • Adopt if:

    • Your PHP app sends >500 CAPI events/month and needs scalable validation.
    • You’re using Laravel/Symfony and want to integrate CAPI without custom parameter logic.
    • Your team lacks expertise in Meta’s parameter schema or event validation rules.
    • You prioritize reducing API rejection rates (invalid parameters = wasted spend).
    • You need multi-language consistency (e.g., syncing with Node.js/Python services).
  • Look elsewhere if:

    • You’re using client-side only (use the JS version instead).
    • Your events are extremely simple (e.g., PageView with no custom data).
    • You require advanced custom transformations beyond Meta’s defaults (may need a wrapper layer).
    • Your stack is not PHP (use the language-specific SDK).
    • You’re already using a third-party ad-tracking tool with built-in CAPI validation (e.g., Branch, AppsFlyer).

How to Pitch It (Stakeholders)

For Executives: *"This is a turnkey solution to fix a critical pain point: invalid Conversions API events. Meta rejects ~10–20% of custom events due to parameter errors, costing us in ad spend and lost attribution data. By adopting Facebook’s PHP parameter builder SDK, we’ll:

  • Cut development time by 30% (no manual validation logic).
  • Reduce API rejections and improve ad performance data accuracy.
  • Future-proof our tracking as Meta tightens parameter requirements. Cost: Zero (open-source). Risk: Low (Meta maintains it). ROI: Immediate—cleaner data = better ad spend efficiency."*

For Engineering: *"This is a lightweight, battle-tested library that handles the tedious work of validating CAPI events for us. Key benefits:

  • Automatic schema validation: Ensures events like Purchase include required fields (e.g., value, currency) with correct types.
  • Error handling: Provides clear feedback if parameters are malformed (e.g., missing data_processing_options).
  • Laravel-friendly: Works seamlessly with HTTP clients (e.g., Guzzle) for sending events.
  • No dependencies: Just composer require facebook/capi-param-builder-php. Implementation: Drop this into your event service layer—it’ll validate payloads before they hit Meta’s API. Example:
use Facebook\Capi\ParamBuilder\ParamBuilder;
$builder = new ParamBuilder();
$event = $builder->buildEvent('Purchase', [
    'value' => 99.99,
    'currency' => 'USD',
    'content_ids' => ['12345'],
]);
// $event is now a validated array ready for CAPI.

Tradeoff: We cede minimal control over parameter formatting, but gain compliance and reliability out of the box."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity