Skip to content

Commit

Permalink
Bring back the woocommerce_ga_gtag_config hook.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalec committed Mar 13, 2024
1 parent 5a9d161 commit 92e96fb
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions includes/class-wc-google-gtag-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,19 @@ public static function tracker_function_name(): string {
* @return array
*/
public function get_site_tag_config(): array {
return array(
'track_404' => 'yes' === self::get( 'ga_404_tracking_enabled' ),
'allow_google_signals' => 'yes' === self::get( 'ga_support_display_advertising' ),
'logged_in' => is_user_logged_in(),
'linker' => array(
'domains' => ! empty( self::get( 'ga_linker_cross_domains' ) ) ? array_map( 'esc_js', explode( ',', self::get( 'ga_linker_cross_domains' ) ) ) : array(),
'allow_incoming' => 'yes' === self::get( 'ga_linker_allow_incoming_enabled' ),
),
'custom_map' => array(
'dimension1' => 'logged_in',
return apply_filters(
'woocommerce_ga_gtag_config',
array(
'track_404' => 'yes' === self::get( 'ga_404_tracking_enabled' ),
'allow_google_signals' => 'yes' === self::get( 'ga_support_display_advertising' ),
'logged_in' => is_user_logged_in(),
'linker' => array(
'domains' => ! empty( self::get( 'ga_linker_cross_domains' ) ) ? array_map( 'esc_js', explode( ',', self::get( 'ga_linker_cross_domains' ) ) ) : array(),
'allow_incoming' => 'yes' === self::get( 'ga_linker_allow_incoming_enabled' ),
),
'custom_map' => array(
'dimension1' => 'logged_in',
),
),
);
}
Expand Down

0 comments on commit 92e96fb

Please sign in to comment.