1. Install the Insert Headers and Footers plugin by WPBeginner. You can do this by going to your WordPress “Plugins” page, clicking “Add New”, and searching for the plugin name.
2. Once installed and activated, in your WordPress menu go to Settings > Insert Headers and Footers.
Ensure that you include the entire code block, including the opening and closing <script> tags, as shown below.