Download the PHP package electrictomcat/laravel-google-ads-conversions without Composer

On this page you can find all versions of the php package electrictomcat/laravel-google-ads-conversions. 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?

Informations about the package laravel-google-ads-conversions

Laravel Google Ads Conversions

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Drop-in offline conversion tracking for Laravel apps using Google Ads.

Status: pre-release. Not yet on Packagist.

Installation

Publish the config and the migration:

Add these to your .env (see Google's OAuth setup for how to mint the refresh token):

Register the middleware in bootstrap/app.php:

Schedule the upload job in routes/console.php:

Usage

Recording a conversion

From anywhere in your app — controllers, jobs, Livewire components, observers:

The first argument is your internal event name. The second is an optional value. The full signature is:

Mapping events to Google Ads conversion actions

Edit config/google-ads-conversions.php. Each event entry is either a string (just the action name) or an array with optional value/currency defaults:

The call site always wins — record('Demo Booked', 999) overrides the config's 250.00. Omit the value at the call site to use the config default.

Bring your own model

The package ships a Lead model and matching migration that work out of the box. If you'd rather use your own model — say, you already have a Visitor table and want to track conversions there — implement the HasConversions contract.

The fastest path: drop the HasConversionsTrait onto your existing model:

Make sure your table has at minimum these columns:

Then point the package at it:

For full control, implement HasConversions from scratch — see src/Contracts/HasConversions.php for the contract.

How the pipeline works

  1. Middleware (CaptureGclid) — runs on the landing request, extracts gclid from the URL, sets cookies + session, buffers a stub lead record in cache.
  2. Recording (GoogleAdsConversions::record()) — pushes a conversion entry into a per-gclid cache bucket. Cheap. Fire from anywhere, including HTTP requests where the user has no gclid on the URL but does have one in their session/cookie.
  3. Sync (syncToDatabase()) — flushes the cache buffer into the configured model's table. Runs as the first half of the queued job.
  4. Upload (uploadPendingConversions()) — finds every pending conversion older than the delay window and ships eligible batches to Google Ads via UploadClickConversions. Marks each shipped conversion as 'uploaded' with a timestamp.

Testing

The suite uses Pest 4 + Orchestra Testbench against an in-memory SQLite database.

Changelog

See CHANGELOG.md.

Contributing

Issues and pull requests welcome.

Credits

License

The MIT License (MIT). See LICENSE.md.


All versions of laravel-google-ads-conversions with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
googleads/google-ads-php Version ^32.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.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 electrictomcat/laravel-google-ads-conversions contains the following files

Loading the files please wait ...