A comprehensive Laravel package for Google Merchant Center integration with product synchronization, batch processing, and automatic sync management.
mannu24/gmc-integration is a Laravel package for a comprehensive laravel package for google merchant center integration with product synchronization, batch processing, and automatic sync management..
It currently has 0 GitHub stars and 9 downloads on Packagist (latest version v1.1.1).
Install it with composer require mannu24/gmc-integration.
Discover more Laravel packages by mannu24
or browse all Laravel packages to compare alternatives.
Last updated
A Laravel package for seamless Google Merchant Center product synchronization with independent tables and optional per-product sync control.
composer require manu/gmc-integration
php artisan vendor:publish --tag=gmc-config
php artisan vendor:publish --tag=gmc-migrations
php artisan migrate
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
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'
];
}
}
gmc_products Tableproduct_id - Reference to your productproduct_type - Model class namesync_enabled - Control sync per productgmc_product_id - GMC's product IDgmc_last_sync - Last sync timestampsync_status - Current sync statuslast_error - Last error messagegmc_sync_logs Table$product->syncwithgmc();
$product->syncToGMC();
$product->forceSyncToGMC();
$gmcService = app(GMCService::class);
$result = $gmcService->syncMultipleProducts($products, 25);
$status = $product->getGMCSyncStatus();
if ($product->isSyncedWithGMC()) {
echo "Product is synced with GMC";
}
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
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
$gmcService = app(GMCService::class);
$gmcService->setBatchSize(25);
$result = $gmcService->syncMultipleProducts($products);
try {
$product->syncwithgmc();
} catch (\Exception $e) {
Log::error('GMC Sync failed: ' . $e->getMessage());
}
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');