GoogleAnalytics
in package
Service class to integrate Blocks with the Google Analytics extension,
Table of Contents
- $asset_api : Api
- Instance of the asset API.
- __construct() : mixed
- Constructor.
- async_script_loader_tags() : string
- Add async to script tags with defined handles.
- enqueue_scripts() : mixed
- Enqueue the Google Tag Manager script if prerequisites are met.
- init() : mixed
- Hook into WP.
- register_assets() : mixed
- Register scripts.
- get_google_analytics_settings() : array<string|int, mixed>
- Get settings from the GA integration extension.
Properties
$asset_api
Instance of the asset API.
protected
Api
$asset_api
Methods
__construct()
Constructor.
public
__construct(Api $asset_api) : mixed
Parameters
- $asset_api : Api
-
Instance of the asset API.
Return values
mixed —async_script_loader_tags()
Add async to script tags with defined handles.
public
async_script_loader_tags(string $tag, string $handle, string $src) : string
Parameters
- $tag : string
-
HTML for the script tag.
- $handle : string
-
Handle of script.
- $src : string
-
Src of script.
Return values
string —enqueue_scripts()
Enqueue the Google Tag Manager script if prerequisites are met.
public
enqueue_scripts() : mixed
Return values
mixed —init()
Hook into WP.
public
init() : mixed
Return values
mixed —register_assets()
Register scripts.
public
register_assets() : mixed
Return values
mixed —get_google_analytics_settings()
Get settings from the GA integration extension.
private
get_google_analytics_settings() : array<string|int, mixed>