snowsoft/laravel-facebook-pixel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

snowsoft/laravel-facebook-pixel

最新稳定版本:v0.01

Composer 安装命令:

composer require snowsoft/laravel-facebook-pixel

包简介

Facebook Pixel integration for Laravel

README 文档

README

Facebook Pixel integration for Laravel

Latest Version on Packagist Software License Quality Score Total Downloads

An easy Facebook Pixel implementation for your Laravel application.

Facebook Pixel

The Facebook pixel is a snippet of JavaScript code that allows you to track visitor activity on your website. It works by loading a small library of functions which you can use whenever a site visitor takes an action (called an event) that you want to track (called a conversion). Tracked conversions appear in the Facebook Ads Manager and in the Facebook Analytics dashboard, where they can be used to measure the effectiveness of your ads, to define custom audiences for ad targeting, for dynamic ads campaigns, and to analyze that effectiveness of your website's conversion funnels.

For concrete examples of what you want to send throught the Standard Events

Install

You can install the package via Composer:

composer require snowsoft/laravel-facebook-pixel

In Laravel 5.5 and up, the package will automatically register the service provider and facade

In L5.4 or below start by registering the package's the service provider and facade:

// config/app.php

'providers' => [
    ...
    WebLAgence\LaravelFacebookPixel\LaravelFacebookPixelServiceProvider::class,
],

'aliases' => [
    ...
    'LaravelFacebookPixel' => WebLAgence\LaravelFacebookPixel\LaravelFacebookPixelFacade::class,
],

Next, publish the config file:

php artisan vendor:publish --provider="WebLAgence\LaravelFacebookPixel\LaravelFacebookPixelServiceProvider"

Configuration

The configuration file is fairly simple.

return [

    /*
     * The Facebook Pixel id, should be a code that looks something like "XXXXXXXXXXXXXXXX".
     */
    'facebook_pixel_id' => '',
   
    /*
     * Use this variable instead of `facebook_pixel_id` if you need to use multiple facebook pixels
     */
    'facebook_pixel_ids' => [],
    
    /*
     * Enable or disable script rendering. Useful for local development.
     */
    'enabled'           => true,
];

Usage

Basic Example

First you'll need to include Facebook Pixel's script. Facebook's docs recommend doing this right after the body tag.

{{-- layout.blade.php --}}
<html>
  <head>
    @include('facebook-pixel::head')
    {{-- ... --}}
  </head>
  <body>
    @include('facebook-pixel::body')
    {{-- ... --}}
  </body>
</html>

Send pixel

At any moment, you can use the next function to create a Standard Event

\LaravelFacebookPixel::createEvent($eventName, $parameters = []);

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email jeremy@weblagence.com instead of using the issue tracker.

License

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

统计信息

  • 总下载量: 40
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 14
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固