Skip to content

Commit

Permalink
Consider ga_gtag_enabled=yes for WCGAI >= 2
Browse files Browse the repository at this point in the history
Addresses #2287 (comment)
  • Loading branch information
tomalec committed Mar 1, 2024
1 parent 3a423a2 commit a114e5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Proxies/GoogleGtagJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public function __construct() {
$this->wcga_settings = get_option( 'woocommerce_google_analytics_settings', [] );

// Prime some values.
if ( empty( $this->wcga_settings['ga_gtag_enabled'] ) ) {
if ( version_compare( \WC_GOOGLE_ANALYTICS_INTEGRATION_VERSION, '2.0.0', '>=' ) ) {
$this->wcga_settings['ga_gtag_enabled'] = 'yes';
} elseif ( empty( $this->wcga_settings['ga_gtag_enabled'] ) ) {
$this->wcga_settings['ga_gtag_enabled'] = 'no';
}
if ( empty( $this->wcga_settings['ga_standard_tracking_enabled'] ) ) {
Expand Down

0 comments on commit a114e5b

Please sign in to comment.