<?php

namespace App\Hooks\Tracking;

use App\Core\Hook\AbstractHook;
use App\Core\Hook\HookManager;

class GoogleAdsHook extends AbstractHook
{
    public function boot(HookManager $hooks): void
    {
        $hooks->listen('ClientAreaHeadOutput', function () {
            $conversionId = setting('google_ads_conversion_id');
            if (empty($conversionId)) {
                return '';
            }
            return view('hooks.tracking.google-ads', ['conversion_id' => $conversionId])->render();
        }, priority: 30, category: 'marketing');
    }
}
