vfixtechnology / bagisto-facebook-pixel
Meta (Facebook) Pixel integration for Bagisto โ tracks PageView, ViewContent, AddToCart, ViewCart, InitiateCheckout, AddShippingInfo, AddPaymentInfo, CompleteRegistration, SignIn, Lead and Purchase standard e-commerce events.
Package info
github.com/vfixtechnology/bagisto-facebook-pixel
pkg:composer/vfixtechnology/bagisto-facebook-pixel
Requires
None
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-17 16:52:57 UTC
README
Meta (Facebook) Pixel integration for Bagisto โ track visitors, measure conversions and supercharge your Meta Ads retargeting & optimization campaigns. ๐
Built with โค๏ธ by Vfix Technology
โจ Features
- โ Zero-Code Setup โ auto-discovered provider, just install and enable
- ๐๏ธ Easy Admin Configuration โ enable, paste your Pixel ID, and you're done
- ๐ 11 Tracked Events โ 10 toggleable events + automatic PageView, full-funnel from product view to purchase
- ๐ Server-Side + Client-Side Tracking โ backend events for reliability, client-side capture for AJAX interactions
- ๐๏ธ Fine-Grained Event Control โ toggle each of the 10 events on or off individually
- ๐ Excellent Developer Experience โ browser console logging utilities
- ๐งช 3 Debug Behaviors โ a single toggle combined with
APP_DEBUGgives Debug Only, Track + Debug, or Track Only - โก Lightweight & Async โ non-blocking snippet with no impact on storefront speed
- ๐จ Native Admin UI โ Facebook Pixel card and icon inside Admin โ Configure
๐ Tracked Events
| ๐ท๏ธ Event | ๐ When? | ๐ฆ Additional Data |
|---|---|---|
| PageView | When a user visits any shop page | โ |
| ViewContent | When a user views a product detail page | content_ids, content_name, value |
| AddToCart | When a user clicks Add to Cart or Buy Now | product_id, quantity, value |
| ViewCart | When a user opens the shopping cart page | content_ids, contents, value |
| InitiateCheckout | When a user opens the checkout page (incl. Buy Now) | content_ids, contents, value |
| AddShippingInfo | When a user fills the address and proceeds to shipping | content_ids, contents, value |
| AddPaymentInfo | When a user selects a payment method (COD, Razorpay, Cashfree, โฆ) | content_ids, contents, value, payment_method |
| CompleteRegistration | When a user registers an account | โ |
| SignIn | When a user signs in to the store | โ |
| Lead | When a user subscribes to the newsletter | โ |
| Purchase | When a user completes an order | content_ids, contents, value, payment_method, eventID |
๐ก PageView is tracked automatically whenever the Pixel is enabled. All other events are ON by default and can be toggled from the admin panel.
๐ Requirements
| Requirement | Version |
|---|---|
| ๐ PHP | >= 8.3 |
| ๐ Bagisto | 2.3.x / 2.4.x |
| ๐งฉ Composer | >= 2.0 |
๐ฆ Installation
โ ๏ธ Run all commands from the root directory of your Bagisto project.
composer require vfixtechnology/bagisto-facebook-pixel
๐งฉ After Install
composer dump-autoload php artisan optimize:clear
๐ง No provider registration needed. The package declares its provider under
extra.laravel.providers, and Bagisto runs Laravel'sphp artisan package:discoverautomatically after everycomposer install/update(via thepost-autoload-dumpscript). Auto-discovery is enabled by default in stock Bagisto 2.3.x and 2.4.x.โ๏ธ You only need to register it manually if your project has turned auto-discovery off โ e.g.
vfixtechnology/bagisto-facebook-pixelis listed underextra.laravel.dont-discover,"*"is used, or Composer was run with--no-scripts. In that case add this line tobootstrap/providers.php:Vfixtechnology\FacebookPixel\Providers\FacebookPixelServiceProvider::class,
๐ ๏ธ Configuration
- ๐งญ Go to Admin Panel โ Configure โ Facebook Pixel
- ๐๏ธ Settings
- Toggle Enable Facebook Pixel โก๏ธ ON
- Paste your Pixel ID (e.g.
123456789012345) - (Optional) Enable Debug Mode for development
- ๐ Event Tracking
- PageView is always enabled automatically
- Toggle ViewContent, AddToCart, ViewCart, InitiateCheckout, AddShippingInfo, AddPaymentInfo, CompleteRegistration, SignIn, Lead, Purchase as needed
- ๐พ Click Save
That's it! ๐ Open any shop page and view the HTML source โ you'll see:
<!-- Bagisto Facebook Pixel | Pixel ID: 123456789012345 -->
๐ Debug Modes
Debugging is automatically selected based on APP_DEBUG (.env) and the Debug Mode toggle in the admin panel:
APP_DEBUG value |
๐ง "Debug Mode" option | Active Mode | ๐ฃ Console Logging | ๐ค Sent to Facebook |
|---|---|---|---|---|
| Any | โ ON | Debug Only | โ Yes | โ No |
true |
โ OFF | Track and Debug | โ Yes | โ Yes |
false |
โ OFF | Track Only (silent) | โ No | โ Yes |
- ๐งช Debug Only โ perfect for development. Logs everything to the browser console, sends nothing to Meta. Ideal for testing.
- ๐๏ธ Track and Debug โ great for staging. Real data sent + console logs for verification.
- ๐ Track Only โ the production default. Clean, silent, performance-optimized.
โ๏ธ How It Works
The package is designed for maximum reliability โ most activities are tracked from backend Laravel events and injected into the next rendered shop page, while AJAX-only interactions (Add to Cart, checkout steps) are captured client-side:
| ๐ท๏ธ Event | ๐งฉ Trigger |
|---|---|
| ViewContent | Product detail page render |
| AddToCart | checkout.cart.add.after โ AJAX button clicks handled client-side |
| ViewCart | Cart page render |
| InitiateCheckout | Checkout page render (Buy Now landing) |
| AddShippingInfo | Checkout address step submit |
| AddPaymentInfo | Checkout payment method selection |
| CompleteRegistration | customer.registration.after |
| SignIn | customer.after.login |
| Lead | customer.subscription.after |
| Purchase | checkout.order.save.after |
๐๏ธ Package Structure
packages/Vfixtechnology/FacebookPixel/
โโโ composer.json
โโโ src/
โโโ Config/system.php # Admin config (Settings + Event Tracking)
โโโ FacebookPixel.php # Core helper
โโโ Http/helpers.php # facebook_pixel() helper
โโโ Listeners/ # Backend event listeners
โโโ Providers/ # Service + Event providers
โโโ Resources/views/ # Pixel head snippet, ViewContent script, credit
๐ค Support
Need help? We're just one message away! ๐ฌ
| ๐ง | info@vfixtechnology.com | |
|---|---|---|
| ๐ | Phone | +91 8447 525 204 |
| ๐ฌ | Chat with us |
๐ฌ Clicking the WhatsApp link pre-fills this message: "I found you from GitHub. Need help in installing Facebook Pixel extension for Bagisto."
We usually reply within 24 hours โฐ.
๐ผ Customization & Paid Installation
๐ ๏ธ Contact us for customization or paid installation support. We can tailor the extension to your business (extra events, custom params, server-side Conversions API) or install and configure it for you end-to-end.
๐ง info@vfixtechnology.com ย ยทย ๐ฌ WhatsApp
๐ License
MIT โ free to use, modify and distribute. See the LICENSE file.
Made with โค๏ธ by Vfix Technology โ Laravel & Bagisto development experts.