Skip to content

Commit

Permalink
Remove unused is_consent_mode_enabled property.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaemnnosttv committed Mar 7, 2024
1 parent 00b4f0e commit aaa0899
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions includes/Modules/Analytics_4/Web_Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,6 @@ class Web_Tag extends Module_Web_Tag implements Tag_Interface {
*/
private $ads_conversion_id;

/**
* Boolean flag for whether Consent Mode is enabled.
*
* @since 1.122.0
* @deprecated This property is deprecated and should be removed when the legacy tag blocking mechanism
* is removed (see the method `Module_Web_Tag::is_tag_blocked_on_consent`).
* @var bool
*/
private $is_consent_mode_enabled;

/**
* Sets custom dimensions data.
*
Expand Down Expand Up @@ -181,12 +171,10 @@ protected function enqueue_gtag_script() {
$snippet_comment_begin = sprintf( "\n<!-- %s -->\n", esc_html__( 'Google Analytics snippet added by Site Kit', 'google-site-kit' ) );
$snippet_comment_end = sprintf( "\n<!-- %s -->\n", esc_html__( 'End Google Analytics snippet added by Site Kit', 'google-site-kit' ) );

if ( ! $this->is_consent_mode_enabled ) {
$block_on_consent_attrs = $this->get_tag_blocked_on_consent_attribute();
$block_on_consent_attrs = $this->get_tag_blocked_on_consent_attribute();

if ( $block_on_consent_attrs ) {
$tag = $this->add_legacy_block_on_consent_attributes( $tag, $gtag_src, $block_on_consent_attrs );
}
if ( $block_on_consent_attrs ) {
$tag = $this->add_legacy_block_on_consent_attributes( $tag, $gtag_src, $block_on_consent_attrs );
}

return $snippet_comment_begin . $tag . $snippet_comment_end;
Expand Down

0 comments on commit aaa0899

Please sign in to comment.