WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Domain\Services

GoogleAnalytics::async_script_loader_tags() public WC 1.0

Add async to script tags with defined handles.

{} It's a method of the class: GoogleAnalytics{}

No Hooks.

Return

String.

Usage

$GoogleAnalytics = new GoogleAnalytics();
$GoogleAnalytics->async_script_loader_tags( $tag, $handle, $src );
$tag(string) (required)
HTML for the script tag.
$handle(string) (required)
Handle of script.
$src(string) (required)
Src of script.

Code of GoogleAnalytics::async_script_loader_tags() WC 5.6.0

public function async_script_loader_tags( $tag, $handle, $src ) {
	if ( ! in_array( $handle, array( 'google-tag-manager' ), true ) ) {
		return $tag;
	}
	// If script was output manually in wp_head, abort.
	if ( did_action( 'woocommerce_gtag_snippet' ) ) {
		return '';
	}
	return str_replace( '<script src', '<script async src', $tag );
}