PHPackages                             grayscale/laravel-ads-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. grayscale/laravel-ads-sdk

Abandoned → [tmarois/laravel-ads-sdk](/?search=tmarois%2Flaravel-ads-sdk)ArchivedPackage[API Development](/categories/api)

grayscale/laravel-ads-sdk
=========================

A Laravel Ads SDK for Google Ads, Bing Ads and Facebook Ads API

v1.5.0(4y ago)971.6k46[9 issues](https://github.com/tmarois/laravel-ads-sdk/issues)[7 PRs](https://github.com/tmarois/laravel-ads-sdk/pulls)PHPPHP &gt;=7

Since Dec 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/tmarois/laravel-ads-sdk)[ Packagist](https://packagist.org/packages/grayscale/laravel-ads-sdk)[ Docs](https://github.com/tmarois/laravel-ads-sdk)[ RSS](/packages/grayscale-laravel-ads-sdk/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (5)Versions (56)Used By (0)

Laravel Ads SDK
===============

[](#laravel-ads-sdk)

[Join the Discord](https://discord.gg/g3W49zdWm2) – For support, updates and collaboration.

For **Google Ads**, **Bing Ads** and **Facebook Ads** API.

This is a wrapper for connecting each ad source into your Laravel application. This SDK provides a cleaner and a more consistent integration across many ad platforms than the official SDKs, and ultimately making it a lot easier to implement in your projects. You shouldn't have to learn how to communicate and understand the responses to every API.

Installation
============

[](#installation)

Use [Composer](http://getcomposer.org/) to install package.

Run `composer require tmarois/laravel-ads-sdk`

Config
======

[](#config)

1. Run `php artisan vendor:publish --tag=laravel-ads-sdk`
2. Copy this to your `.env` and update with your credentials (if you dont have credentials, continue to the next step).

```
ADWORDS_DEVELOPER_TOKEN=""
ADWORDS_OAUTH2_CLIENT_ID=""
ADWORDS_OAUTH2_CLIENT_SECRET=""
ADWORDS_OAUTH2_REFRESH_TOKEN=""

BING_DEVELOPER_TOKEN=""
BING_CLIENT_ID=""
BING_CLIENT_SECRET=""
BING_REFRESH_TOKEN=""

FB_APP_ID=""
FB_APP_SECRET=""
FB_ACCESS_TOKEN=""
FB_REFRESH_TOKEN=""

```

Authentication
==============

[](#authentication)

### 👉 For GoogleAds

[](#point_right-for-googleads)

You will need your developer token, client id and client secret to continue. [Learn More](GoogleAds-Auth.md)

*Follow the steps in the command line to **generate a refresh token**.*

Run `php artisan laravelads:token:generate --service=GoogleAds`

Having Trouble? [Learn More](GoogleAds-Auth.md)

### 👉 For BingAds

[](#point_right-for-bingads)

You will need your developer token, client id and client secret to continue. [Learn More](BingAds-Auth.md)

*Follow the steps in the command line to **generate a refresh token**.*

Run `php artisan laravelads:token:generate --service=BingAds`

Having Trouble? [Learn More](BingAds-Auth.md)

### 👉 For FacebookAds

[](#point_right-for-facebookads)

You will need your app id, app secret and access token. [Learn More](FacebookAds-Auth.md)

*NOTE: It appears for facebook, you do not need to generate refresh token, once you have your access token, the api should connect as long as you've given yourself the correct access, permissions, scopes to marketing api and ads account.*

🚀 Usage
=======

[](#rocket-usage)

Accessing `GoogleAds`, `BingAds` or `FacebookAds` use the following:

```
// The namespace to the Facade for laravel Ads SDK
use LaravelAds;

// calling Google Ads and including the Account ID
$googleAds = LaravelAds::googleAds()->with('ACCOUNT_ID');

// calling Bing Ads and including the Account ID
$bingAds = LaravelAds::bingAds()->with('ACCOUNT_ID');

// calling Facebook Ads and including the Account ID
$facebookAds = LaravelAds::facebookAds()->with('ACCOUNT_ID');
```

Google Ads
==========

[](#google-ads)

This uses the [googleads-php-lib](https://github.com/googleads/googleads-php-lib) SDK for the [Google Ads API](https://developers.google.com/adwords/api/docs/guides/start)

> **NOTICE** – You will need to [Request Google Ads API Access](https://services.google.com/fb/forms/newtoken/).

[Need help with authentication?](GoogleAds-Auth.md)

#### Management

[](#management)

- [Fetching - All Campaigns](GoogleAds-SDK.md#fetch-all-campaigns)
- [Fetching - All Ad Groups](GoogleAds-SDK.md#fetch-all-ad-groups)
- [Management - Campaigns](GoogleAds-SDK.md#campaigns)
- [Management - Ad Groups](GoogleAds-SDK.md#ad-groups)
- [Offline Conversion Import](GoogleAds-SDK.md#offline-conversion-import)
- [Manual Configuration](GoogleAds-SDK.md#manual-configuration)
- [Advanced Options](GoogleAds-SDK.md#need-more-advanced-options)

#### Reports

[](#reports)

- [Account Performance](GoogleAds-SDK.md#account-reports)
- [Campaign Performance](GoogleAds-SDK.md#campaign-reports)
- [Ad Group Performance](GoogleAds-SDK.md#ad-group-reports)
- [Final URL Performance](GoogleAds-SDK.md#final-url-performance-report)
- [Placement Domain Performance](GoogleAds-SDK.md#placement-domain-performance-report)
- [Placement URL Performance](GoogleAds-SDK.md#placement-url-performance-report)
- [Search Term Performance](GoogleAds-SDK.md#search-term-performance-report)
- [Age Range Performance](GoogleAds-SDK.md#age-range-performance-report)
- [Gender Performance](GoogleAds-SDK.md#gender-performance-report)

Bing Ads
========

[](#bing-ads)

This uses the [BingAds-PHP-SDK](https://github.com/BingAds/BingAds-PHP-SDK) for the [Bing Ads API](https://docs.microsoft.com/en-us/bingads/guides/get-started-php?view=bingads-12)

> **NOTICE** – You will need to [Request Bing Ads API Access](https://advertise.bingads.microsoft.com/en-us/resources/bing-partner-program/request-bing-ads-api-access).

[Need help with authentication or sandbox mode?](BingAds-Auth.md)

#### Management

[](#management-1)

- [Fetching - Get Customers](BingAds-SDK.md#fetch-customers)
- [Fetching - All Campaigns](BingAds-SDK.md#fetch-all-campaigns)
- [Fetching - All Ad Groups](BingAds-SDK.md#fetch-all-ad-groups)
- [Management - Campaigns](BingAds-SDK.md#campaigns)
- [Management - Ad Groups](BingAds-SDK.md#ad-groups)
- [Offline Conversion Import](BingAds-SDK.md#offline-conversion-import)
- [Manual Configuration](BingAds-SDK.md#manual-configuration)

#### Reports

[](#reports-1)

- [Account Performance](BingAds-SDK.md#account-reports)
- [Campaign Performance](BingAds-SDK.md#campaign-reports)
- [Ad Group Performance](BingAds-SDK.md#ad-group-reports)
- [Final URL Performance](BingAds-SDK.md#final-url-performance-report)
- [Search Term Performance](BingAds-SDK.md#search-term-performance-report)
- [Age Range Performance](BingAds-SDK.md#age-range-performance-report)
- [Gender Performance](BingAds-SDK.md#gender-performance-report)
- [Custom Fields](BingAds-SDK.md#custom-fields)

Facebook Ads
============

[](#facebook-ads)

This uses the [facebook-php-business-sdk](https://github.com/facebook/facebook-php-business-sdk) for [Facebook Marketing API](https://developers.facebook.com/docs/marketing-apis)

#### Management

[](#management-2)

- [Fetching - Campaigns](FacebookAds-SDK.md#white_check_mark-fetch-campaigns)
- [Fetching - Ad Groups](FacebookAds-SDK.md#white_check_mark-fetch-ad-groups)

#### Reports

[](#reports-2)

- [Account Performance](FacebookAds-SDK.md#white_check_mark-account-reports)
- [Campaign Performance](FacebookAds-SDK.md#white_check_mark-campaign-reports)
- [Ad Group Performance](FacebookAds-SDK.md#white_check_mark-ad-group-reports)

Customization
=============

[](#customization)

We realize that we can't add every endpoint so in order to help improve your developer experience, we have made the Service classes Macroable. Macros are a way to add a new custom method to the classes. This way you are able to utilize the existing auth and all of the other goodies that come with this package.

Typically, you should call this method from the boot method of one of your application's service providers, such as the `App\Providers\AppServiceProvider` service provider:

```
public function boot()
{
    LaravelAds\Services\BingAds\Service::macro('addUetTags', function($tags){
        $serviceCall = $this->call(ServiceClientType::CampaignManagementVersion13);

        try {
            $request = new AddUetTagsRequest();
            $request->UetTags = $tags;

            $serverResponse = $serviceCall->GetService()->AddUetTags($request);

            return $serverResponse;
        } catch (\Exception $e) {
            print $serviceCall->GetService()->__getLastRequest()."\n";
            print $serviceCall->GetService()->__getLastResponse()."\n";
        }
    });

    LaravelAds\Services\GoogleAds\Service::macro('dd', function(){
        dd($this);
    });
}
```

Then in your controller or job you would call:

```
$bingAds = LaravelAds::bingAds()->addUetTags([
    [
        'Name' => 'Extensible!',
        'Description' => 'No PR Needed!',
    ]
]);

$bingAds = LaravelAds::googleAds()->dd();
```

Contributions
=============

[](#contributions)

We are actively looking for new contributors.

If you want to contribute, [Join the Discord](https://discord.gg/g3W49zdWm2) channel and/or submit pull requests.

License
=======

[](#license)

**Laravel Ads SDK** (This Package) is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). USE AT YOUR OWN RISK. Laravel Ads SDK is a tool to help you manage your accounts, it does not guarantee features listed here will work as described. If you do find a bug, please feel free to submit an issue. *This package is not affiliated with Laravel LLC or the Laravel Framework team.*

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 81.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~64 days

Total

47

Last Release

1494d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb2a1c2cd3f429541c1151da87ffedea46ff881b554626520b4e090b270bf5fc?d=identicon)[timothymarois](/maintainers/timothymarois)

---

Top Contributors

[![timothymarois](https://avatars.githubusercontent.com/u/2489333?v=4)](https://github.com/timothymarois "timothymarois (195 commits)")[![modernben](https://avatars.githubusercontent.com/u/67608755?v=4)](https://github.com/modernben "modernben (19 commits)")[![zacksmash](https://avatars.githubusercontent.com/u/6118407?v=4)](https://github.com/zacksmash "zacksmash (7 commits)")[![SamuelDeanA](https://avatars.githubusercontent.com/u/82799765?v=4)](https://github.com/SamuelDeanA "SamuelDeanA (4 commits)")[![myen-ln](https://avatars.githubusercontent.com/u/16342764?v=4)](https://github.com/myen-ln "myen-ln (4 commits)")[![rob-orch](https://avatars.githubusercontent.com/u/62103348?v=4)](https://github.com/rob-orch "rob-orch (2 commits)")[![dmyers](https://avatars.githubusercontent.com/u/207171?v=4)](https://github.com/dmyers "dmyers (2 commits)")[![PaulSaundersRealRates](https://avatars.githubusercontent.com/u/60095525?v=4)](https://github.com/PaulSaundersRealRates "PaulSaundersRealRates (1 commits)")[![eugenefvdm](https://avatars.githubusercontent.com/u/1836436?v=4)](https://github.com/eugenefvdm "eugenefvdm (1 commits)")[![hmaesta](https://avatars.githubusercontent.com/u/741969?v=4)](https://github.com/hmaesta "hmaesta (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![vantezzen](https://avatars.githubusercontent.com/u/10333196?v=4)](https://github.com/vantezzen "vantezzen (1 commits)")

---

Tags

adwords-apibing-adsbing-ads-apibingadsbingads-sdkcampaign-performancefacebook-apifacebook-marketing-apifacebookadsgoogle-adsgoogle-ads-apigoogle-adwordsgoogleads-sdklaravel-adsapiadsbing adsgoogle adsFacebook ADS

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/grayscale-laravel-ads-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/grayscale-laravel-ads-sdk/health.svg)](https://phpackages.com/packages/grayscale-laravel-ads-sdk)
```

###  Alternatives

[edujugon/laravel-google-ads

Google Adwords API for Laravel

66424.7k](/packages/edujugon-laravel-google-ads)[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)[edbizarro/laravel-facebook-ads

Facebook &amp; Instagram Ads for Laravel 5.6+

13629.5k](/packages/edbizarro-laravel-facebook-ads)[spotonlive/laravel-google-ads

Google Ads API for Laravel

6391.1k](/packages/spotonlive-laravel-google-ads)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
