PHPackages                             ahmokhan1/meta-ads - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ahmokhan1/meta-ads

ActiveLibrary[API Development](/categories/api)

ahmokhan1/meta-ads
==================

Meta Ads (CAPI + Insights) integration for Laravel CRM

v1.0.9(2mo ago)06MITPHPPHP ^8.1

Since Feb 18Pushed 2mo agoCompare

[ Source](https://github.com/Ahmokhan1/meta-ads)[ Packagist](https://packagist.org/packages/ahmokhan1/meta-ads)[ RSS](/packages/ahmokhan1-meta-ads/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (11)Used By (0)

Meta Ads (CAPI + Insights)
==========================

[](#meta-ads-capi--insights)

Laravel package for Meta Conversions API uploads and Marketing API insights sync.

Install
-------

[](#install)

```
composer require ahmokhan1/meta-ads
```

Publish config and migrations:

```
php artisan vendor:publish --tag=meta-ads-config
php artisan vendor:publish --tag=meta-ads-migrations
php artisan migrate
```

Optional Lead model stub:

```
php artisan vendor:publish --tag=meta-ads-models
```

Requirements
------------

[](#requirements)

- Laravel 10, 11, or 12
- PHP 8.1+ (Laravel 12 requires PHP 8.2+)

Environment
-----------

[](#environment)

```
META_ADS_ACCESS_TOKEN=
META_ADS_AD_ACCOUNT_ID=
META_ADS_PIXEL_ID=
META_ADS_API_VERSION=v21.0
META_ADS_CURRENCY_CODE=GBP
META_ADS_EVENT_NAME=Purchase
META_ADS_ACTION_SOURCE=website
META_ADS_TEST_EVENT_CODE=
META_ADS_CONVERSION_VALUE=0
META_ADS_ALLOW_LOCAL=false
```

Optional model/table overrides:

```
META_ADS_LEAD_MODEL=App\Models\Lead
META_ADS_LEADS_TABLE=leads
```

Required Lead Columns
---------------------

[](#required-lead-columns)

Leads table:

- `fbclid`, `fbc`, `fbp`
- `meta_campaign_id`, `meta_ad_set_id`, `meta_ad_id`
- `meta_conversion_sent_at`, `meta_conversion_error`

These are created by the published migrations. If your project already has a leads table, the migration will add any missing Meta fields.

Conversions (CAPI)
------------------

[](#conversions-capi)

Dispatch after a lead is enrolled/created:

```
use Ahmokhan1\MetaAds\Jobs\SendMetaAdsConversionJob;

SendMetaAdsConversionJob::dispatch($lead->id)->delay(now()->addSeconds(5));
```

Behavior:

- Event id uses `lead-{id}`.
- `meta_conversion_sent_at` is set only when Meta responds with `events_received >= 1`.

Enable local testing with:

```
META_ADS_ALLOW_LOCAL=true
META_ADS_TEST_EVENT_CODE=TEST123
```

Insights Sync
-------------

[](#insights-sync)

Sync daily campaign metrics:

```
php artisan meta-ads:sync --days=30
```

Use in scheduler:

```
$schedule->command('meta-ads:sync --days=30')->dailyAt('01:20');
```

Tables:

- `meta_ads_accounts`
- `meta_ads_campaigns`
- `meta_ads_metrics_daily`

Notes
-----

[](#notes)

- This package expects standard Meta UTMs/click ids to be captured in your lead/order records.
- Update `config/meta_ads.php` if your model/table names differ.

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance82

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

10

Last Release

89d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f110f891a63f1c9e4990806c24c2498a4c0d49a4bf51c75163109889facf642?d=identicon)[Ahmokhan1](/maintainers/Ahmokhan1)

---

Top Contributors

[![Ahmokhan1](https://avatars.githubusercontent.com/u/46791604?v=4)](https://github.com/Ahmokhan1 "Ahmokhan1 (10 commits)")

### Embed Badge

![Health badge](/badges/ahmokhan1-meta-ads/health.svg)

```
[![Health](https://phpackages.com/badges/ahmokhan1-meta-ads/health.svg)](https://phpackages.com/packages/ahmokhan1-meta-ads)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k49.4M479](/packages/laravel-scout)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[flat3/lodata

OData v4.01 Producer for Laravel

96320.9k](/packages/flat3-lodata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
