Home > OS >  How to Hide Your own Visits to Your Site From Google Analytics?
How to Hide Your own Visits to Your Site From Google Analytics?

Time:06-25

Google Analytics Problem

I am building my website and for that purpose, i have to visite my website several time. When i make some changes to the code or i upload some new content.

But the problem i am facing is that the google analytics is continuously tracking my own visits and displaying relatively greater number of visitors.

Kindly somebody helps me to overcome this google analytics view issue. So that i can easily hide my visits from google analytics effectively.

CodePudding user response:

To my knowledge, there are three methods to hide self-visits from google analytics.

1. Google Analytics, Filter IP Address

In this method, we will add a filter to the google analytics dashboard. We use the IP address to filter out the traffic. For this purpose, follow these steps.

Step 1: Open Image for Google Analytics Filter IP address

  • IP Address: Add your IP address in the input field provided to you by your network provider.
  • Apply Filters To View: Select the view from the list, which you want to exclude
  • Click Save Congrats, you have added an IP filter.
  • 2. Google Chrome Extension

    This method is really simple and easy to configure. Just add this chrome extension and you are all set up. This extension will block google analytics to track your visits.

    3. PHP Conditional Statement

    This is a really simple method and I myself use it on my website TutsInsider. You have to just follow these steps to get the job done.

    Step 1: Go to your theme folder and open the file which contains the Google Analytics tag. We mostly add this code in header.php in WordPress.

    Step 2: Scroll to the code line where you have entered the Google analytics script.

    Step 3: Wrap this script with the following if statement.

    if ( ! is_user_logged_in() ) { 
    
    // Google Analytics Script Goes here
    
    }
    

    You are fine now, as long as you are logged in to WordPress, the page visits won't load the google analytics script. Hence, if the Analytics script is not loaded, Google won't be able to know if someone visited the site.

    CodePudding user response:

    Inside Google Analytics you can easily make some changes and block your own visits by adding your IP address. If you don't know your IP address visit the following sites to find it- https://whatismyipaddress.com/ and https://www.whatismyip.com/

    Your IP address will look like this: 105.57.186.42 (example). Now that you know your IP address please note it down.

    Login to Your Google Analytics Dashboard and select your website property.

    Now select Admin from the left side pane. Select the account where you don't want the visits to be tracked. Now, select All Filters. Then click on ADD FILTER.

    Enter any filter name, for example, I have given "Exclude Own Visits".

    Under Filter Type, by default Predefined is selected. Leave it as it is.

    Under select filter type select Exclude.

    Under select source or destination select traffic from the IP addresses.

    Under Select expression select that are equal to.

    Now enter your IP address which you don't Google Analytics to track.

    Then under Apply Filter to Views select All Web Site Data and click on Add.

    • Related