rezkonline / laravel-meta-pixel
Meta Pixel Integration for Laravel framework
Installs: 83
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/rezkonline/laravel-meta-pixel
Requires
- php: ^7.4|^8.0|^8.1
- illuminate/support: ^7.0|^8.0|^9.0|^10.0
Requires (Dev)
- laravel/legacy-factories: ^1.3
- mockery/mockery: ^1.5
- orchestra/testbench: ^6.0|^7.0|^8.0
This package is not auto-updated.
Last update: 2025-10-11 07:54:50 UTC
README
Install
composer require rezkonline/laravel-meta-pixel
In Laravel 5.5 and up
The package will be automatically registered it's Service Provider and Facade
In Laravel 5.4 or below
// config/app.php 'providers' => [ // \Rezkonline\LaravelMetaPixel\Providers\MetaPixelServiceProvider::class, // ], 'facades' => [ // 'LaravelMetaPixel' => \Rezkonline\LaravelMetaPixel\Facades\MetaPixelFacade::class, // ],
Next, publish the config file:
php artisan vendor:publish --provider="Rezkonline\LaravelMetaPixel\Providers\MetaPixelServiceProvider"
Configuration
return [ /* * The Facebook Meta ID. */ 'meta_pixel_id' => env('META_PIXEL_ID', ''), ];
Usage
Basic Usage
{{-- layout.blade.php --}} <html> <head> @include('meta-pixel::script') {{-- !!! --}} </head> <body> {{-- !!! --}} </body> </html>
Send Event
Call a function based on Meta Pixel standarted events Standard Event according to the following table:
| Event | Method |
|---|---|
| AddPaymentInfo | addPaymentInfoEvent |
| AddToCart | addToCartEvent |
| AddToWishlist | addToWishlistEvent |
| CompleteRegistration | completeRegistrationEvent |
| Contact | contactEvent |
| CustomizeProduct | customizeProductEvent |
| Donate | donateEvent |
| FindLocation | findLocationEvent |
| Lead | leadEvent |
| InitiateCheckout | initiateCheckoutEvent |
| Purchase | purchaseEvent |
| Schedule | scheduleEvent |
| Search | searchEvent |
| StartTrial | startTrialEvent |
| SubmitApplication | submitApplicationEvent |
| Subscribe | subscribeEvent |
| ViewContent | viewContentEvent |
Example
\LaravelMetaPixel::addToCartEvent([ // List of event parameters ])
License
The MIT License (MIT). Please head to License File for more information.