GoogleAnalytics4/Application/Model/ManagerTypes.php

68 lines
2.0 KiB
PHP
Raw Normal View History

<?php
namespace D3\GoogleAnalytics4\Application\Model;
use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics;
class ManagerTypes
{
2024-05-31 15:47:54 +02:00
const EXTERNAL_SERVICE = "eigener Service";
const NET_COOKIE_MANAGER = "Netensio Cookie Manager";
/**
* Further information's:
* https://github.com/aggrosoft/oxid-cookie-compliance
*/
const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance";
const CONSENTMANAGER = "Consentmanager";
const INTERNAL_CONSENTMANAGER = "cmconsentmanager";
2024-05-31 15:47:54 +02:00
const COOKIEFIRST = "Cookiefirst";
2023-06-27 08:33:49 +02:00
2024-05-31 15:47:54 +02:00
const COOKIEBOT = "Cookiebot";
2023-09-07 15:08:06 +02:00
/**
* @return array
*/
public function getManagerList(): array
{
return [
"externalService" => self::EXTERNAL_SERVICE,
"agcookiecompliance" => self::AGCOOKIECOMPLIANCE,
"net_cookie_manager" => self::NET_COOKIE_MANAGER,
Usercentrics::sModuleIncludationInternalName => Usercentrics::sModuleIncludationPublicName,
Usercentrics::sExternalIncludationInternalName => Usercentrics::sExternalIncludationPublicName,
"cmconsentmanager" => self::CONSENTMANAGER,
2023-09-07 15:08:06 +02:00
"cookiefirst" => self::COOKIEFIRST,
"cookiebot" => self::COOKIEBOT,
];
}
/**
* @param string $sManager
* @return bool
*/
public function isManagerInList(string $sManager) :bool
{
2024-05-31 15:47:54 +02:00
return in_array($sManager, array_keys($this->getManagerList()), true);
}
/**
* @return array
*
* the CMP from this method always needs the script tag delivered to the dom.
*/
public function scriptTagDeliveredByDefaultArray() :array
{
return [
Usercentrics::sModuleIncludationInternalName,
Usercentrics::sExternalIncludationInternalName,
ManagerTypes::CONSENTMANAGER,
ManagerTypes::INTERNAL_CONSENTMANAGER,
ManagerTypes::COOKIEFIRST,
ManagerTypes::COOKIEBOT,
ManagerTypes::EXTERNAL_SERVICE
];
}
}