Disable Google Analytics in preview-mode

When you do a lot of editing in your blog, all the pageviews in preview-mode kinda mess with your Google Analytics stats. This is easy to prevent with a conditional tag called is_preview(). Replace your Google Analytics code with this code.

Code Snippet:

<?php 
if( !is_preview()) {
  # Google Analytics Code #
}
?>

Posted in Admin area