Automattic\WooCommerce\Blocks\Domain\Services
GoogleAnalytics::init
Hook into WP.
Method of the class: GoogleAnalytics{}
No Hooks.
Returns
null. Nothing (null).
Usage
$GoogleAnalytics = new GoogleAnalytics(); $GoogleAnalytics->init();
GoogleAnalytics::init() GoogleAnalytics::init code WC 10.8.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 );
}