May 6, 2011

How to Exclude your Own Visits From Blogger Stats?

When we are developing any blog or website then normally we want to watch the traffic on our site or blog. There are lots of traffic source tracker sites and tools are available on the net, but I found 2 more effective tools where we can check our traffic stat very easily. 1 is Google Analytic and second one is Blog Stat which is recently launched in blogger platform.

Blogger stats is excellent way to track world wide traffic on you blogger blog. It is now built in facility by and very much similar to Google Analytic and it will be similar because both are from Google only.

Benefit of Blogger stat
Main benefit of blogger stat is you do not need to add any external code to track your traffic source like hitstat, google analytics, sitemeter etc.

In Google analytic is was easy to exclude your own visits but how to exclude your own visit from blogger stat?

So here the step by step guide to exclude your own visit from blogger stat.

First go to and login there.

From dash board might you have more then 1 blog so find your blog where you want to exclude your stat and click on stat tab on that blog details like below figure 1

Figure 1

Now in overview section(tab) on stat tab there is page view details at right side like pageview today etc under that widget you can see don't track own visit link, see below figure 2

Figure 2

now once you click on that link don't track own visit it will open on small popup with 2 radio button.
Track my pageview and
Don't track my pageview

select second option don's track my page view and click on save button like below figure and you are done. Now blogger will exclude you own visit from traffic source details.

read more

May 5, 2011

How to Prevent or disable copy content of your blog/site


If you want that visitor will not be able to copy your content from web page then it's easy using JavaScript.
It's not full proof way there are other alternate they can copy but it will not be easy way for them to copy content by just selecting required content, right click and click on copy.
Just add following JavaScript code to your blog templates and it will be secure that other user will not be able to copy content easily.
Just go to Blogger Dashboard.
Click on Design Tab –> then click on Page element.
Now you can see add a gadget link many places. Just click any one of them and select HTML and Javascript widget and paste following code to opened dialog box.

<script type="text/javascript">
    var donotconsidortag = ["input", "textarea", "select"]
    donotconsidortag = donotconsidortag.join("|")
    function unableToSelect(e) {
        if (donotconsidortag.indexOf( == -1)
            return false
    function ableToSelect() {
        return true
    if (typeof document.onselectstart != "undefined")
        document.onselectstart = new Function("return false")
    else {
        document.onmousedown = unableToSelect
        document.onmouseup = ableToSelect

Then save the templates and check it. If it's working fine then you are done else you have made some mistake, to correct it repeat the process.

Enjoy the post. If you like my post then either left a comment or do subscribe my rss in you favourite rss feed reader to get latest update from me.

read more

May 1, 2011

Generating a random number in JavaScript


Today I was working in a DayPilot project it was something like Google or outlook calender. In that project when I was creating or editing event, it was using java script popup. But it was showing old value rather than new or updated value when popup open. This was happening due to JavaScript because it was running from cache. 
How to fill new or updated value in control it was a big concern? So what I had done is just create one random number and append it at the end of URL so every time new http request will be different in browser and it will not run from cache.

So now how to generate a random number?

Lets begin by looking back. As discussed in this post to generate a random number in JavaScript, the code:

var randomnumber=Math.random();

                  This is the function which will return next random number between 0.0 to 0.999999 so this will generate decimal number every time. If we require integer number then we can convert it using either round or floor function.

                  The round() method rounds a number to the nearest integer.

                   The floor() method rounds a number DOWNWARDS to the nearest integer, and returns the result.

So finally we can use it as like this

randomnumber = Math.floor(Math.random());

randomnumber = Math.round(Math.random());

it will return value between 0 to 9

read more

Author Profile

Total Pageviews