Skip to content

Commit

Permalink
Added a lower priority to force MA script right before closing head tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan0sz committed Jan 6, 2025
1 parent 038e55f commit f600f57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/frontend/class-tracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public function insert_tracking_code() {

/**
* Since no other libraries are loaded when Minimal Analytics is enabled, we can't use
* wp_add_inline_script(). That's why we're echo-ing it into wp_head/wp_footer.
* @see wp_add_inline_script(). That's why we're echo-ing it into wp_head/wp_footer.
*/
if ( CAOS::uses_minimal_analytics() ) {
switch ( CAOS::get( CAOS_Admin_Settings::CAOS_BASIC_SETTING_SCRIPT_POSITION, 'header' ) ) {
Expand All @@ -317,7 +317,7 @@ public function insert_tracking_code() {
case 'manual':
break;
default:
add_action( 'wp_head', [ $this, 'insert_minimal_tracking_snippet' ] );
add_action( 'wp_head', [ $this, 'insert_minimal_tracking_snippet' ], 100000 );
break;
}

Expand Down

0 comments on commit f600f57

Please sign in to comment.