-----
isHidden: false
menupriority: 1
kind: article
created_at: 2010-06-17T16:37:22+02:00
title: Hide Yourself to your Analytics
author_name: Yann Esposito
author_uri: yannesposito.com
tags:
- analytics
- statistics
- hide
- blog
- jQuery
- javascript
-----
This is a way not to count your own visits to your blog.
First you should look on how [I handle analytics](/Scratch/en/blog/2010-06-17-track-events-with-google-analytics). All analytics are handled in one javascript file, this make things really convenient.
Then you need to know my method use the `jquery-cookie`.
I check if the key `admin` is not set in the cookie before adding the visit.
var admin = $.cookie('admin');
if (! admin) {
// put your analytics code here
} else {
console.log("[WARNING] you're HIDDEN to analytics");
}
then create two html files. One to hide:
Hide to analytics
the other to be visible again (it can be useful):
Hide to analytics
Now accessing these files with you browser you can *hide* or *appear* in your statistics. You just have to think to access these file from all you browser.