Google Tag Manager - v1.0.0
CmsFramework
ArtisanPackUI\GoogleTagManager\CmsFramework\ContainerOverviewWidget and TagListWidget are the CMS-framework admin dashboard wrappers around the two Livewire components.
Each extends the underlying Livewire component and implements ArtisanPackUI\CMSFramework\Modules\AdminWidgets\Contracts\AdminWidgetInterface.
ContainerOverviewWidget
Extends the ContainerOverview Livewire component.
getWidgetInfo(): array
Returns:
[
'title' => __( 'Google Tag Manager container overview' ),
'description' => __( 'Container name, public ID, workspace, tag/trigger/variable counts, and the latest published version.' ),
'capability' => 'view_tag_manager',
'default_options' => [
'accountId' => '',
'containerId' => '',
'workspaceId' => null,
],
]
mount() override
Both widget wrappers override mount() with an all-optional signature so the CMS AdminWidgetManager can instantiate them by class name with no explicit props. When account or container IDs are empty, the initial refresh is skipped — the widget renders its empty state until the admin configures it.
TagListWidget
Extends the TagList Livewire component.
getWidgetInfo(): array
Returns:
[
'title' => __( 'Google Tag Manager tags' ),
'description' => __( 'Tag list for a workspace: name, type, firing triggers, and status, with sort and pagination.' ),
'capability' => 'view_tag_manager',
'default_options' => [
'accountId' => '',
'containerId' => '',
'workspaceId' => '',
'perPage' => 10,
],
]
Registration
Registration is automatic when both artisanpack-ui/cms-framework and livewire/livewire are installed. See CMS Framework Widgets for the flow and customization.
Guard
Because the wrapper classes declare implements AdminWidgetInterface at class-definition time, they cannot be loaded when the CMS framework is missing (the interface would be unresolvable and the class body would fatal on autoload). The service provider guards registration with interface_exists before referencing the class. Anywhere else you touch these wrappers — including tests — do the same, referencing them via string literals inside conditional branches that verify the interface is autoloadable first.