Download the PHP package combindma/laravel-facebook-pixel without Composer

On this page you can find all versions of the php package combindma/laravel-facebook-pixel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-facebook-pixel

Meta Pixel integration for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Complete Meta pixel implementation for your Laravel application.

About Combind Agency

Combine Agency is a leading web development agency specializing in building innovative and high-performance web applications using modern technologies. Our experienced team of developers, designers, and project managers is dedicated to providing top-notch services tailored to the unique needs of our clients.

If you need assistance with your next project or would like to discuss a custom solution, please feel free to website for more information about our services. Let's build something amazing together!

Introduction

This package provides a smooth integration of Meta Pixel, along with a straightforward implementation of the latest Conversions API, enhancing your overall experience.

Upgrading to Version 5

If you are upgrading from version 4, please refer to our Version 5 Migration Guide for detailed instructions on how to make a smooth transition.

Pre-requisites

Register a Meta Pixel

To get started with the Meta pixel, you must have a pixel registered: Read this guide.

Conversions API

If you plan to use Conversions API then you need to:

Obtain An Access Token

To use the Conversions API, you need to generate an access token, which will be passed as a parameter in every API call.

Refer to Conversions API Guide to learn more.

Installation

You can install the package via composer:

Optionally, you can publish the views using:

You can publish the config file with:

This is the contents of the published config file:

If you plan on using the flash-functionality you must register the MetaPixelMiddleware:

Global Middleware:

Or Assigning Middleware to Routes (recommended if you have admin routes):

Usage - Meta Pixel

Include scripts in Blade

Insert head view after opening head tag, and body view after opening body tag

If you use UUID as user id you should add userIdAsString attribute to the head component:

To add an event, use the track() function.

This renders:

You can also specify a unique event ID for any of your events so that, if you plan using the conversions API you avoid duplications.

Flashing data for the next request

The package can also set event to render on the next request. This is useful for setting data after an internal redirect.

After a form submit, the following event will be parsed on the contact page:

Available Methods

Custom Events

You can also track a specific custom event on your website. This feature is not available for flashed events.

This renders:

Advanced matching

This package provides by default advanced matching. We retrieve the email and the user id from authenticated user and include it in the Pixel base code fbq('init') function call as a third parameter. You can disable it by adding META_PIXEL_ADVANCED_MATCHING_ENABLED=false in your .env file

Macroable

Adding events to pages can become a repetitive process. Since this package isn't supposed to be opinionated on what your events should look like, the MetaPixel is macroable.

Usage - Conversions API

If you plan on using Conversions API functionalities. Yous should specify the token in your .env file first.

For every request yous should specify a unique event id for handling Pixel Duplicate Events and Conversions API.

This is how you can start:

If you don't specify the $user_data parameter, by default we retrieve the email & the id from Auth::user() if the user is authenticated. We use the user id as a same external_id in Meta Pixel and conversions API

If you want to test server events, you need to specify the FACEBOOK_TEST_EVENT_CODE in your .env file. By default, this test code will be sent in all API request.

So Don't forget to delete after you finish your server tests.

You can use the Playload Helper to learn more about the requests to send.

Testing

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-facebook-pixel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
facebook/php-business-sdk Version ^19.0
illuminate/contracts Version ^10.0|^11.0
spatie/laravel-package-tools Version ^1.11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package combindma/laravel-facebook-pixel contains the following files

Loading the files please wait ....