WooCommerce Code Reference

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

Methods

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

get_google_analytics_settings()

Get settings from the GA integration extension.

private get_google_analytics_settings() : array<string|int, mixed>
Return values
array<string|int, mixed>