From fd4f1ec7c0878d3944d2ffe30a9ace3369b027ce Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Tue, 1 Aug 2023 09:38:51 -0600 Subject: [PATCH] Add async loading attribute frontend script --- includes/frontend/events/class-gtag-events.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/frontend/events/class-gtag-events.php b/includes/frontend/events/class-gtag-events.php index 97e8fbef..8b1cfbb0 100644 --- a/includes/frontend/events/class-gtag-events.php +++ b/includes/frontend/events/class-gtag-events.php @@ -100,6 +100,7 @@ public function output_javascript() { $suffix = ''; } wp_enqueue_script( 'monsterinsights-frontend-script', plugins_url( 'assets/js/frontend-gtag' . $suffix . '.js', MONSTERINSIGHTS_PLUGIN_FILE ), array(), monsterinsights_get_asset_version(), false ); + wp_script_add_data( 'monsterinsights-frontend-script', 'strategy', 'async' ); wp_localize_script( 'monsterinsights-frontend-script', 'monsterinsights_frontend',