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.
4
Answers
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.
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 Google Analytics and go to the admin menu at the left bottom of the screen.
Step 2: If you are using Universal Analytics View, then there will be three views, i.e. Account, Property, and View. The first and last view has All Filters options, navigate to any of these.
Step 3: Open the All Filters menu and click the Add Filter button, this will open a new form.
Step 4: Fill out the form fields
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
.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.
In Google’s official analytics for WordPress plugin Site Kit by Google there’s a setting to remove all logged in users from analytics or just users with post creation capability
As you’re using the Site Kit plugin, the default behavior for Google Analytics is to not track logged in users. For that reason all you need to do is to ensure this default configuration remains active, as @Moshe-Gross mentioned. Then when you’re working on your site ensure you are logged in with a WP administrator account, so your visits are not tracked.