PHPackages                             mannu24/gmc-integration - 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. mannu24/gmc-integration

ActiveLibrary[API Development](/categories/api)

mannu24/gmc-integration
=======================

A comprehensive Laravel package for Google Merchant Center integration with product synchronization, batch processing, and automatic sync management.

v1.1.1(10mo ago)09MITPHPPHP ^8.0|^8.1|^8.2|^8.3

Since Jul 19Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/mannu24/google-merchant-center)[ Packagist](https://packagist.org/packages/mannu24/gmc-integration)[ Docs](https://github.com/mannu24/google-merchant-center)[ RSS](/packages/mannu24-gmc-integration/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (6)Versions (7)Used By (0)

Google Merchant Center Integration Package
==========================================

[](#google-merchant-center-integration-package)

A Laravel package for seamless Google Merchant Center product synchronization with independent tables and optional per-product sync control.

Installation
------------

[](#installation)

```
composer require manu/gmc-integration
```

Setup
-----

[](#setup)

1. **Publish config:**

```
php artisan vendor:publish --tag=gmc-config
```

2. **Publish migrations:**

```
php artisan vendor:publish --tag=gmc-migrations
```

3. **Run migrations:**

```
php artisan migrate
```

4. **Set environment variables:**

```
GMC_MERCHANT_ID=your_merchant_id
GMC_SERVICE_ACCOUNT_JSON=/path/to/service-account.json
GMC_AUTO_SYNC=true
GMC_THROW_EXCEPTIONS=false
GMC_BATCH_SIZE=50
GMC_RETRY_ATTEMPTS=3
```

5. **Add trait to your product model:**

```
use Manu\GMCIntegration\Traits\SyncsWithGMC;

class Product extends Model
{
    use SyncsWithGMC;

    protected $fillable = [
        'title', 'description', 'price', 'quantity', 'image_url',
        'brand', 'sku', 'status'
    ];

    public function prepareGMCData(): array
    {
        return [
            'offerId' => $this->sku ?: (string) $this->id,
            'title' => $this->title,
            'description' => $this->description,
            'link' => url("/products/{$this->id}"),
            'imageLink' => $this->image_url,
            'price' => ['value' => (string) $this->price, 'currency' => 'USD'],
            'availability' => $this->quantity > 0 ? 'in stock' : 'out of stock',
            'brand' => $this->brand,
            'condition' => 'new'
        ];
    }
}
```

Database Structure
------------------

[](#database-structure)

### `gmc_products` Table

[](#gmc_products-table)

- `product_id` - Reference to your product
- `product_type` - Model class name
- `sync_enabled` - Control sync per product
- `gmc_product_id` - GMC's product ID
- `gmc_last_sync` - Last sync timestamp
- `sync_status` - Current sync status
- `last_error` - Last error message

### `gmc_sync_logs` Table

[](#gmc_sync_logs-table)

- Tracks all sync attempts
- Stores request/response data
- Performance metrics
- Error details

Features
--------

[](#features)

- Independent tables - No modifications to existing tables
- Clean model - All GMC methods in trait
- Optional per-product sync control
- Manual and automatic syncing
- Bulk operations with batch processing
- Error handling with retry logic
- Data validation before syncing
- Rate limiting to avoid API limits
- Cache protection against duplicate syncs
- Async processing for better performance
- Sync history tracking

Usage Examples
--------------

[](#usage-examples)

### Manual Syncing

[](#manual-syncing)

```
$product->syncwithgmc();
$product->syncToGMC();
$product->forceSyncToGMC();
```

### Bulk Operations

[](#bulk-operations)

```
$gmcService = app(GMCService::class);
$result = $gmcService->syncMultipleProducts($products, 25);
```

### Sync Status

[](#sync-status)

```
$status = $product->getGMCSyncStatus();
if ($product->isSyncedWithGMC()) {
    echo "Product is synced with GMC";
}
```

### Artisan Commands

[](#artisan-commands)

```
php artisan gmc:sync-all
php artisan gmc:sync-all --filter="status=active"
php artisan gmc:sync-all --dry-run
php artisan gmc:sync-all --force
php artisan gmc:sync-all --chunk=25
```

Configuration
-------------

[](#configuration)

```
GMC_MERCHANT_ID=your_merchant_id
GMC_SERVICE_ACCOUNT_JSON=/path/to/service-account.json
GMC_AUTO_SYNC=true
GMC_BATCH_SIZE=50
GMC_RETRY_ATTEMPTS=3
GMC_RETRY_DELAY=1000
GMC_CACHE_DUPLICATE_SYNCS=true
GMC_CACHE_DURATION=300
GMC_LOG_SYNC_EVENTS=true
GMC_LOG_LEVEL=info
```

Advanced Features
-----------------

[](#advanced-features)

### Batch Processing

[](#batch-processing)

```
$gmcService = app(GMCService::class);
$gmcService->setBatchSize(25);
$result = $gmcService->syncMultipleProducts($products);
```

### Error Handling

[](#error-handling)

```
try {
    $product->syncwithgmc();
} catch (\Exception $e) {
    Log::error('GMC Sync failed: ' . $e->getMessage());
}
```

### Sync History

[](#sync-history)

```
use Manu\GMCIntegration\Models\GMCSyncLog;

$logs = GMCSyncLog::with('gmcProduct')->latest()->get();
$failedLogs = GMCSyncLog::where('status', 'failed')->get();
$avgResponseTime = GMCSyncLog::where('status', 'success')->avg('response_time_ms');
```

Performance Optimizations
-------------------------

[](#performance-optimizations)

- Batch processing for large datasets
- Rate limiting to avoid API throttling
- Cache protection against duplicate syncs
- Async processing for better response times
- Retry logic for failed operations
- Memory efficient chunking
- Independent tables for better performance

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance54

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~6 days

Total

6

Last Release

316d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/65483269?v=4)[Manu Kumar](/maintainers/mannu24)[@mannu24](https://github.com/mannu24)

---

Top Contributors

[![mannu24](https://avatars.githubusercontent.com/u/65483269?v=4)](https://github.com/mannu24 "mannu24 (16 commits)")

---

Tags

laravellaravel-packageecommerceproduct syncgoogle-shoppinggoogle-merchant-centergmcmerchant-center

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mannu24-gmc-integration/health.svg)

```
[![Health](https://phpackages.com/badges/mannu24-gmc-integration/health.svg)](https://phpackages.com/packages/mannu24-gmc-integration)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M199](/packages/laravel-ai)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M166](/packages/spatie-laravel-health)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.9k1](/packages/mike-bronner-laravel-model-caching)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)

PHPackages © 2026

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