/* AdSense Script for WordPress */
add_action('wp_head','wpflt_ga_adsense', 20);
function wpflt_ga_adsense() {
?>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-xxxxxxxxxxxxxxxxxx"
crossorigin="anonymous"></script>
<?php
};
Add this code to your child theme’s functions.php to install the Google AdSense script for all users. Replace xxxxxxxxxxxxxxxxx in the above code with your AdSense Code.
If you want to disable Google AdSense for Logged in users, follow this link to run AdSense ads only for visitors.