PHPackages                             webmid/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. webmid/laravel-ads-sdk

ActivePackage[API Development](/categories/api)

webmid/laravel-ads-sdk
======================

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

01PHP

Since Jun 20Pushed 2y agoCompare

[ Source](https://github.com/webmid/laravel-ads-sdk)[ Packagist](https://packagist.org/packages/webmid/laravel-ads-sdk)[ RSS](/packages/webmid-laravel-ads-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)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 webmid/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

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 82.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2791b813d4f155f1d693b65cfe70c3673ca0756e61bf25cab15b67d1e4c0a2c2?d=identicon)[webmid](/maintainers/webmid)

---

Top Contributors

[![timothymarois](https://avatars.githubusercontent.com/u/2489333?v=4)](https://github.com/timothymarois "timothymarois (194 commits)")[![modernben](https://avatars.githubusercontent.com/u/67608755?v=4)](https://github.com/modernben "modernben (19 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)")[![omid-barely](https://avatars.githubusercontent.com/u/210318191?v=4)](https://github.com/omid-barely "omid-barely (2 commits)")[![zacksmash](https://avatars.githubusercontent.com/u/6118407?v=4)](https://github.com/zacksmash "zacksmash (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)")[![PaulSaundersRealRates](https://avatars.githubusercontent.com/u/60095525?v=4)](https://github.com/PaulSaundersRealRates "PaulSaundersRealRates (1 commits)")[![vantezzen](https://avatars.githubusercontent.com/u/10333196?v=4)](https://github.com/vantezzen "vantezzen (1 commits)")[![webmid](https://avatars.githubusercontent.com/u/51325641?v=4)](https://github.com/webmid "webmid (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

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