Add a read-only Google AdSense analytics module for admins.
Connect AdSense over OAuth, sync entities and daily reports locally, and show placement performance in the admin panel without calling the Management API from public pages.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Services\Adsense;
|
||||
|
||||
final class AdsenseSyncResult
|
||||
{
|
||||
/**
|
||||
* @param list<string> $failedReports
|
||||
*/
|
||||
public function __construct(
|
||||
public string $accountDisplayName = '',
|
||||
public string $from = '',
|
||||
public string $to = '',
|
||||
public int $adUnits = 0,
|
||||
public int $customChannels = 0,
|
||||
public int $totalRows = 0,
|
||||
public int $adUnitRows = 0,
|
||||
public int $customChannelRows = 0,
|
||||
public int $platformRows = 0,
|
||||
public int $countryRows = 0,
|
||||
public array $failedReports = [],
|
||||
public bool $entitiesSynced = false,
|
||||
public bool $reconnectRequired = false,
|
||||
) {}
|
||||
|
||||
public function succeeded(): bool
|
||||
{
|
||||
return ! $this->reconnectRequired && $this->failedReports === [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user