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.
Download electrictomcat/laravel-google-ads-conversions
More information about electrictomcat/laravel-google-ads-conversions
Files in electrictomcat/laravel-google-ads-conversions
Package laravel-google-ads-conversions
Short Description Drop-in offline conversion tracking for Laravel: captures GCLIDs from ad clicks, buffers conversions in cache, and uploads them to the Google Ads API.
License MIT
Homepage https://github.com/electrictomcat/laravel-google-ads-conversions
Informations about the package laravel-google-ads-conversions
Laravel Google Ads Offline Conversions
Production-ready, drop-in offline conversion tracking for Laravel applications. Captures Google Ads click identifiers (gclid, gbraid, wbraid), buffers conversions in cache with zero database lag, and uploads them to the Google Ads API v17/v18.
โก Need Meta CAPI, TikTok, LinkedIn, Microsoft Ads, or WooCommerce?
If you need multi-channel server-to-server tracking across Meta CAPI (v20.0), TikTok Events API, LinkedIn CAPI, Microsoft Advertising, an in-app live reporting dashboard, or turnkey WordPress & WooCommerce integration, check out OmniSignal Pro.
Key Features
- ๐ฏ Full Click Attribution: Captures
gclid(Search/Display) as well asgbraidandwbraid(iOS 14.5+ ATT app/web clicks) and maintains attribution across visitor sessions. - โก One-Line Recording: Record conversions from anywhere โ controllers, Livewire, queued jobs, Eloquent observers (
GoogleAdsConversions::record(...)). - ๐ช๐บ GDPR, ePrivacy & Consent Mode v2 Ready: Prior-consent cookie gating, automated 90-day retention pruning via
Prunable, and explicit Google Consent Mode signals (ad_user_data,ad_personalization). - ๐ Enhanced Conversions for Leads: Strict data minimization with SHA-256 hashed email & phone numbers.
- ๐งช First-Class Testing Support: Built-in
GoogleAdsConversions::fake()for easy test assertions in your application test suite. - ๐ High Performance & Safe Batching: Buffers in cache behind a sharded, lock-guarded dirty set, syncs to database, and uploads in batched requests of up to 2,000 conversions.
- ๐ฆ Bring Your Own Model: Use the included
Leadmodel or dropHasConversionsTraitonto your existingUser,Visitor, orOrdermodels. - ๐ ๏ธ Artisan Tooling: Dedicated CLI commands for installing, testing credentials against live APIs, syncing cache, and running dry-run uploads.
Requires PHP 8.3+ and Laravel 11, 12, or 13.
Installation
Publish configuration and database migration:
Run migrations:
Configuration
Add your Google Ads API credentials to your .env file:
Usage
1. Register the Click Capture Middleware & Exempt Cookies
In your bootstrap/app.php (Laravel 11+), register the middleware and exempt the package's attribution cookies from encryption so client-side JavaScript can read them:
2. Record a Conversion Event (Server-Side)
3. Client-Side JavaScript Tracking
Add the @googleAdsScript directive to your layout (e.g. before </head> or </body>):
This injects the global window.trackGoogleAdsConversion(eventName, value, currency, orderId) helper. It inspects client cookies (google_ads_gclid, google_ads_gbraid, google_ads_wbraid) and dispatches the conversion via navigator.sendBeacon (falling back to fetch) to the package's built-in endpoint:
4. Navigation Micro-Conversions (Full-Page & SPA)
Track forward page navigation micro-conversions for ad-attributed visitors across full-page loads and SPA transitions (Livewire wire:navigate, Turbo, Inertia):
This directive only renders if the visitor has an active ad attribution (GoogleAdsConversions::hasAttribution()). It automatically posts navigation events (Page Navigation: /path) when visitors navigate forward.
5. Blade Directive for HTML Forms
Inject hidden click identifiers (gclid, gbraid, wbraid) into your contact or checkout forms:
6. Built-In Route Configuration
The package automatically exposes a route for client-side conversions (POST /api/google-ads/track-conversion, named google-ads-conversions.track). You can customize the route in config/google-ads-conversions.php:
7. Testing with fake()
๐ Need Multi-Platform Tracking?
For Meta CAPI (v20.0), TikTok Events API, LinkedIn Conversions API, Microsoft Advertising, and WooCommerce support, upgrade to OmniSignal Pro.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-google-ads-conversions with dependencies
googleads/google-ads-php Version ^33.4 || ^34.0 || ^35.0
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0