header.php
管理者以外の場合はアナリティクス表示
<?php if (!current_user_can('manage_options')):?>
<script type="text/javascript" >
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', "UA-xxxxxxxxx-1", 'auto');
ga('send', 'pageview');
</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
<?php else:endif;?>
コメント