Download the PHP package edujugon/laravel-google-ads without Composer

On this page you can find all versions of the php package edujugon/laravel-google-ads. 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?
edujugon/laravel-google-ads
Rate from 1 - 5
Rated 5.00 based on 1 reviews

Informations about the package laravel-google-ads

Google Adwords API for Laravel

Simple and easy to use API for your Google Adwords.

Installation

Type in console:
Laravel 5.5 or higher?

Then you don't have to either register or add the alias, this package uses Package Auto-Discovery's feature, and should be available as soon as you install it via Composer.

(Only for Laravel 5.4 or minor) Register the GoogleAds service by adding it to the providers array.
(Only for Laravel 5.4 or minor) Let's add the Alias facade, add it to the aliases array.
Publish the package's configuration file to the application's own config directory.

The above command will generate a new file under your laravel app config folder called google-ads.php

Configuration

Update the google-ads.php file with your data.

'env' key accepts one of the following values: test / production

Generate refresh token

Notice that it will take the clientID and clientSecret from google-ads.php config file based on the env value.

Type in console:

Remember to copy that token in the correct section (test/production).Depends on your env value.

Usage samples

Instance the main wrapper class:

Do not forget to put at the top of the file the use statement:

All needed configuration data is took from google-ads.php config file. But you always may pass new values on the fly if required.

You may override the default environment value calling the env method:

Also, you may get the env value by getEnv method:

If need to override the oAuth details, just call the oAuth method like so:

Same with session. If need to override the default values on the fly, just do it by calling session method:

All the above methods can be chained as follows:

Google Services

For Google Ads Services you only have to call the service method:

or

or

or Any google ads services available under Google\AdsApi\AdWords\v201809\cm folder.

Also you can use the global helper in order the get an instance of Service.

To retrieve a list of campaigns, do like follows:

Notice the method select is required and you have to use it in order to set the fields you wanna get from the campaign.

If need to add a condition to your search you can use the where method like follows:

Notice! You may also set more than one condition. Do so calling where method as many times as you need.

Available Operators:

If need to limit your search you may use limit method:

Also you can order by a field:

Notice that the get method returns an instance of ServiceCollection. That custom collection has its own methods.

Once you have the collection, you can again filter with the where method

Also you can call the set method to change any value

Finally you can persist those changes with the save method:

Save method returns an array of updated elements or false if nothing updated.

Important!! notice that it will persist all elements that are in the collection.

You can get the list as illuminate collection simply calling items method.

Google Reports

To start with google reporting just call report method from the main wrapper:

or use the global helper like follows:

It will return an instance of Edujugon\GoogleAds\Reports\Report

Now, you have a set of method to prepare the google ads report:

In the above methods, the mandatory ones are from and select

Notice that in during method you have to pass the dates as a string like YearMonthDay

You may also want to set more than one condition. Use Where clause as many times as you need like follows:

Available Operators:

Want to exclude any field? Just do it like follows:

If want to see the retrieve items, just get so by result property of the object returned:

Notice that it is a Collection. So you have all collection methods available.

If need the report in another format, just call format method before getting the report:

To see the available report formats:

To see what fields are available for a specific report type you can do like follows:

If want to know what report types are available, just do like follow:

There are 3 output formats for the report. It can be as object, as stream, as string.

Also you can save the report in a file:

The above code will create a file in the passed path returning true if everything was fine.

API Documentation

Full API List


All versions of laravel-google-ads with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^5.1||^6.0||^7.0||^8.0
illuminate/console Version ^5.1||^6.0||^7.0||^8.0
googleads/googleads-php-lib Version >=37.0
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 edujugon/laravel-google-ads contains the following files

Loading the files please wait ....