How to check if user is an admin in wordpress

The best way so far to check whether the current user is a super admin user with full permissions in wordpress is to use current_user_can function and check for manage_options . If user has manage_options they clearly have full permissions. I use this for example to hide ads from me and to hide google analytics so that it doesn’t count me while I’m logged in as admin.

  1.  <?php if (!current_user_can( 'manage_options' )):?>
  2.  google analytics code goes here
  3.  <?php endif;?>