0?yæÃÀxæà BßYU°?€? ß2ßYUOÿÿÿÿÿÿÿÿd 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0 0yæàß2ßYUOÿÿÿÿÿÿÿÿd 0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0 °yæàß2ßYUOÿÿÿÿÿÿÿÿd100 1578 0 1578 0 0 366 0 --:--:-- 0:00:04 --:--:-- 366 0yæàß2ßYUOÿÿÿÿÿÿÿÿd100 1578 0 1578 0 0 366 0 --:--:-- 0:00:04 --:--:-- 366 °yæàß2ßYU"ÿÿÿÿÿÿÿÿ(&[2025-01-10 22:23:06] Successful 0yæàß2ßYUMÿÿÿÿÿÿÿÿd---------------------------------------------------------------------------- °yæàß2ßYUPÿÿÿÿÿÿÿÿd % Total % Received % Xferd Average Speed Time Time Time Current 0yæàß2ßYUNÿÿÿÿÿÿÿÿd Dload Upload Total Spent Left Speed °yæàß2ßYUOÿÿÿÿÿÿÿÿd 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0yæàß2ßYUOÿÿÿÿÿÿÿÿd100 664 0 664 0 0 515 0 --:--:-- 0:00:01 --:--:-- 514 °yæàß2ßYUOÿÿÿÿÿÿÿÿd100 664 0 664 0 0 514 0 --:--:-- 0:00:01 --:--:-- 514 0yæàß2ßYU"ÿÿÿÿÿÿÿÿ(&[2025-01-10 22:24:03] Successful °yæàß2ßYUMÿÿÿÿÿÿÿÿd---------------------------------------------------------------------------- 0yæàß2ßYUPÿÿÿÿÿÿÿÿd % Total % Received % Xferd Average Speed Time Time Time Current °yæàß2ßYUNÿÿÿÿÿÿÿÿd Dload Upload Total Spent Left Speed 0yæàß2ßYUOÿÿÿÿÿÿÿÿd 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 °yæàß2ßYUOÿÿÿÿÿÿÿÿd 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0 0yæàß2ßYUOÿÿÿÿÿÿÿÿd 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0 °yæàß2ßYUOÿÿÿÿÿÿÿÿd100 1578 0 1578 0 0 527 0 --:--:-- 0:00:02 --:--:-- 527 0 yæàß2ßYUOÿÿÿÿÿÿÿÿd100 1578 0 1578 0 0 527 0 --:--:-- 0:00:02 --:--:-- 527 ° yæàß2ßYU"ÿÿÿÿÿÿÿÿ(&[2025-01-10 22:25:04] Successful 0 yæàß2ßYUMÿÿÿÿÿÿÿÿd---------------------------------------------------------------------------- ° yæàß2ßYUPÿÿÿÿÿÿÿÿd % Total % Received % Xferd Average Speed Time Time Time Current 0 yæàß2ßYUNÿÿÿÿÿÿÿÿd Dload Upload Total Spent Left Speed ° yæàß2ßYUOÿÿÿÿÿÿÿÿd 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 yæàß2ßYUOÿÿÿÿÿÿÿÿd 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 ° yæàß2ßYUOÿÿÿÿÿÿÿÿd100 665 0 665 0 0 568 0 --:--:-- 0:00:01 --:--:-- 568 0 yæàß2ßYUOÿÿÿÿÿÿÿÿd100 665 0 665 0 0 568 0 --:--:-- 0:00:01 --:--:-- 568 ° yæàß2ßYU"ÿÿÿÿÿÿÿÿ(&[2025-01-10 22:26:03] Successful 0yæàß2ßYUMÿÿÿÿÿÿÿÿd---------------------------------------------------------------------------- °yæàß2ßYUPÿÿÿÿÿÿÿÿd % Total % Received % Xferd Average Speed Time Time Time Current 0yæàß2ßYUNÿÿÿÿÿÿÿÿd Dload foreach ( $this->tags as $tag ) { wp_add_inline_script( self::HANDLE, $this->get_gtag_call_for_tag( $tag ) ); } $filter_google_gtagjs = function ( $tag, $handle ) { if ( self::HANDLE !== $handle ) { return $tag; } $snippet_comment_begin = sprintf( "\n\n", esc_html__( 'Google tag (gtag.js) snippet added by Site Kit', 'google-site-kit' ) ); $snippet_comment_end = sprintf( "\n\n", esc_html__( 'End Google tag (gtag.js) snippet added by Site Kit', 'google-site-kit' ) ); return $snippet_comment_begin . $tag . $snippet_comment_end; }; add_filter( 'script_loader_tag', $filter_google_gtagjs, 20, 2 ); } /** * Method used to return gtag() config call for selected tag. * * @since 1.124.0 * @access protected * * @param array $tag The Gtag tag, along with its config parameters. * * @return string Gtag call for tag in question. */ protected function get_gtag_call_for_tag( $tag ) { return empty( $tag['config'] ) ? sprintf( 'gtag("config", "%s");', esc_js( $tag['tag_id'] ) ) : sprintf( 'gtag("config", "%s", %s);', esc_js( $tag['tag_id'] ), wp_json_encode( $tag['config'] ) ); } /** * Method used to return gtag call for specific command. * * @since 1.124.0 * @access protected * * @param array $command The command array with applicable command and params. * * @return string Gtag function call for specific command. */ protected function get_gtag_call_for_command( $command ) { $gtag_args = array_merge( array( $command['command'] ), $command['parameters'] ); $gtag_args = array_map( function ( $arg ) { return wp_json_encode( $arg ); }, $gtag_args ); return sprintf( 'gtag(%s);', implode( ',', $gtag_args ) ); } /** * Returns the gtag source URL. * * @since 1.124.0 * @since 1.142.0 Provides support for first-party mode. * * @return string|false The gtag source URL. False if no tags are added. */ public function get_gtag_src() { if ( empty( $this->tags ) ) { return false; } // Load the GTag scripts using the first tag ID - it doesn't matter which is used, // all registered tags will be set up with a config command regardless // of which is used to load the source. $tag_id = rawurlencode( $this->tags[0]['tag_id'] ); // If first-party mode is active, use the proxy URL to load the GTag script. if ( Feature_Flags::enabled( 'firstPartyMode' ) && $this->is_first_party_mode_active() ) { return add_query_arg( array( 'id' => $tag_id, 's' => '/gtag/js', ), plugins_url( 'fpm/measurement.php', GOOGLESITEKIT_PLUGIN_MAIN_FILE ) ); } return 'https://www.googletagmanager.com/gtag/js?id=' . $tag_id; } /** * Checks if first-party mode is active. * * @since 1.142.0 * * @return bool True if first-party mode is active, false otherwise. */ protected function is_first_party_mode_active() { $first_party_mode_settings = new First_Party_Mode_Settings( $this->options ); $settings = $first_party_mode_settings->get(); $required_settings = array( 'isEnabled', 'isFPMHealthy', 'isScriptAccessEnabled' ); foreach ( $required_settings as $setting ) { if ( ! isset( $settings[ $setting ] ) || ! $settings[ $setting ] ) { return false; } } return true; } }