All Projects β†’ edbizarro β†’ Laravel Facebook Ads

edbizarro / Laravel Facebook Ads

Licence: mit
Facebook & Instagram Ads API for Laravel

Projects that are alternatives of or similar to Laravel Facebook Ads

Facebook
πŸ“¨ Facebook Notifications Channel for Laravel
Stars: ✭ 120 (+37.93%)
Mutual labels:  facebook-api, laravel, facebook
messenger
πŸ’¬ A PHP library for Facebook Messenger
Stars: ✭ 53 (-39.08%)
Mutual labels:  facebook, facebook-api
lambda-facebook-oauth
An AWS Lambda function to facilitate Oauth2 social login with Facebook
Stars: ✭ 16 (-81.61%)
Mutual labels:  facebook, facebook-api
Laravel Social Auto Posting
🌈Laravel social auto posting
Stars: ✭ 306 (+251.72%)
Mutual labels:  laravel, facebook
facebook-login-for-robots
Facebook Login for πŸ€– robots
Stars: ✭ 41 (-52.87%)
Mutual labels:  facebook, facebook-api
facebook-ruby-ads-sdk
The Facebook Marketing API in Ruby.
Stars: ✭ 59 (-32.18%)
Mutual labels:  facebook, facebook-api
Multistreamer
[discontinued] A webapp for publishing video to multiple streaming services at once.
Stars: ✭ 281 (+222.99%)
Mutual labels:  facebook-api, facebook
facebook-bot-autoresponder
Facebook bot that automatically responds to the comments of a certain post
Stars: ✭ 90 (+3.45%)
Mutual labels:  facebook, facebook-api
React Facebook
Facebook components like a Login button, Like, Share, Chat, Comments, Page or Embedded Post
Stars: ✭ 661 (+659.77%)
Mutual labels:  facebook-api, facebook
Fb Messenger Cli
fb-messenger-cli, console Facebook messenger
Stars: ✭ 665 (+664.37%)
Mutual labels:  facebook-api, facebook
Restfb
RestFB is a simple and flexible Facebook Graph API client written in Java.
Stars: ✭ 681 (+682.76%)
Mutual labels:  facebook-api, facebook
Facebook-Auto-Pilot
Automate common Facebook activities such as posting to groups and pages walls. Effortlessly post to multiple groups or pages.
Stars: ✭ 126 (+44.83%)
Mutual labels:  facebook, facebook-api
facebook-node-sdk
Modeled from the (Facebook Javascript SDK), now with the facebook-node-sdk you can now easily write the same code and share between your server (nodejs) and the client (Facebook Javascript SDK).
Stars: ✭ 519 (+496.55%)
Mutual labels:  facebook, facebook-api
facebook-go-sdk
A very simple and easy-to-use Facebook SDK for Golang.
Stars: ✭ 18 (-79.31%)
Mutual labels:  facebook, facebook-api
facebook-messenger
Go (GoLang) package for Facebook Messenger API and Chat bot
Stars: ✭ 62 (-28.74%)
Mutual labels:  facebook, facebook-api
facebook-py-sdk
Facebook Python SDK
Stars: ✭ 15 (-82.76%)
Mutual labels:  facebook, facebook-api
Socialite
Socialite is an OAuth2 Authentication tool. It is inspired by laravel/socialite, you can easily use it without Laravel.
Stars: ✭ 1,026 (+1079.31%)
Mutual labels:  laravel, facebook
node-social-feed-api
Aggregates social media feeds and outputs them to use in an API
Stars: ✭ 20 (-77.01%)
Mutual labels:  facebook-api, instagram-api
Facebook-Album-Browser
jQuery plugin for browsing public albums of a Facebook account
Stars: ✭ 76 (-12.64%)
Mutual labels:  facebook, facebook-api
Facebook Cli
πŸ’» Facebook command line tool
Stars: ✭ 350 (+302.3%)
Mutual labels:  facebook-api, facebook

logo

Laravel Facebook Ads

Get ads infos (campaigns, ads, insights, etc...) from Facebook & Instagram Ads API

  • Supported Facebook API version: >= v3.0

Packagist Code Climate Codacy Badge StyleCI Packagist


Installation

Follow this steps to use this package on your Laravel installation

Installing with composer

composer require edbizarro/laravel-facebook-ads

The package will automatically register it's service provider.

For Laravel <= 5.4 add the provider manually

Load service provider (optional Laravel <= 5.4 only)

You need to update your config/app.php configuration file to register our service provider, adding this line on providers array:

Edbizarro\LaravelFacebookAds\Providers\LaravelFacebookServiceProvider::class

Enable the facade (optional)

This package comes with an facade to make the usage easier. To enable it, add this line at config/app.php on alias array:

'FacebookAds' => Edbizarro\LaravelFacebookAds\Facades\FacebookAds::class

Configuration

If you want to change any configurations, you need to publish the package configuration file. To do this, run artisan vendor:publish --provider="Edbizarro\LaravelFacebookAds\Providers\LaravelFacebookServiceProvider" on terminal. This will publish a facebook-ads.php file on your configuration folder like this:

<?php
return [
    'app_id' => env('FB_ADS_APP_ID'),
    'app_secret' => env('FB_ADS_APP_SECRET'),
];

Note that this file uses environment variables, it's a good practice put your secret keys on your .env file adding this lines on it:

FB_ADS_APP_ID="YOUR_APP_ID"
FB_ADS_APP_SECRET="YOUR_APP_SECRET_KEY"

First steps

Before using it, it's necessary to initialize the library with an valid access token, php example with:

FacebookAds::init($accessToken);

Now that everything is set up, it's easy to start using!

Example getting all ads

$ads = FacebookAds::adAccounts()->all()->map(function ($adAccount) {
  return $adAccount->ads(
      [
          'name',
          'account_id',
          'account_status',
          'balance',
          'campaign',
          'campaign_id',
          'status'
      ]
  );
});

Usage

To obtain a list of all AdAccount available fields, look at this.

adAccounts

To obtain an adAccounts instance:

$adAccounts = $adsApi->adAccounts();

all

Use this method to retrieve your owned Ad Accounts. This method accepts an array as argument containing a list of fields.

To obtain a list of all available fields, look at this.

$adAccounts->all(['account_id', 'balance', 'name']);

get

Use this method to get details of an AdAccount. This method accepts an array as argument containing a list of fields and an account_id act_<AD_ACCOUNT_ID>

To obtain a list of all available fields, look at this.

$adAccounts->get(['account_id', 'balance', 'name'], 'act_<AD_ACCOUNT_ID>');

Campaigns

To obtain an Campaigns instance:

$campaigns = $adsApi->campaigns();

all

Use this method to retrieve your adAccount campaigns. This method accepts an array as argument containing a list of fields and an account_id act_<AD_ACCOUNT_ID>

To obtain a list of all available fields, look at this.

$campaigns->all(['name'], 'act_<AD_ACCOUNT_ID>');

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].