Search by

vfixtechnology / bagisto-facebook-pixel

vfixtechnology.com

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

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-09-17 16:46 UTC

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_DEBUG gives 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's php artisan package:discover automatically after every composer install/update (via the post-autoload-dump script). 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-pixel is listed under extra.laravel.dont-discover, "*" is used, or Composer was run with --no-scripts. In that case add this line to bootstrap/providers.php:

Vfixtechnology\FacebookPixel\Providers\FacebookPixelServiceProvider::class,

๐Ÿ› ๏ธ Configuration

  1. ๐Ÿงญ Go to Admin Panel โ†’ Configure โ†’ Facebook Pixel
  2. ๐ŸŽ›๏ธ Settings
    • Toggle Enable Facebook Pixel โžก๏ธ ON
    • Paste your Pixel ID (e.g. 123456789012345)
    • (Optional) Enable Debug Mode for development
  3. ๐Ÿ“Š Event Tracking
    • PageView is always enabled automatically
    • Toggle ViewContent, AddToCart, ViewCart, InitiateCheckout, AddShippingInfo, AddPaymentInfo, CompleteRegistration, SignIn, Lead, Purchase as needed
  4. ๐Ÿ’พ 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! ๐Ÿ’ฌ

๐Ÿ“ง Email info@vfixtechnology.com
๐Ÿ“ž Phone +91 8447 525 204
๐Ÿ’ฌ WhatsApp 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.