Automattic\WooCommerce\Blocks\Domain\Services

GoogleAnalytics::init()publicWC 1.0

Hook into WP.

Method of the class: GoogleAnalytics{}

No Hooks.

Return

null. Nothing (null).

Usage

$GoogleAnalytics = new GoogleAnalytics();
$GoogleAnalytics->init();

GoogleAnalytics::init() code WC 8.6.1

public function init() {
	// Require Google Analytics Integration to be activated.
	if ( ! class_exists( 'WC_Google_Analytics_Integration', false ) ) {
		return;
	}
	add_action( 'init', array( $this, 'register_assets' ) );
	add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
	add_filter( 'script_loader_tag', array( $this, 'async_script_loader_tags' ), 10, 3 );
}