How to Exclude Internal Traffics while using Google Analytic App?

Hi, everyone!

If I install Google Analytic script via Cloudflare App, how can I exclude internal traffics?

Please guide me an easy way.

Thanks & Regards,

I believe that is something you manage from within your Google Analytics account.

Create an IP address filter
To prevent internal traffic from affecting your data, you can use a filter to filter out traffic by IP address.

You can find the public IP address you are currently using by searching “what is my ip address” on You can find out what IP addresses and subnets your company uses by asking your network administrator.

To create an IP address filter:

  1. Follow the instructions to create a new filter for your view.
  2. Leave the Filter Type as Predefined.
  3. Click the Select filter type drop-down menu and select Exclude.
  4. Click the Select source or destination drop-down menu and select traffic from the IP addresses.
  5. Click the Select expression drop-down menu and select the appropriate expression.
  6. Enter the IP address or a regular expression. See the examples below.


Thanks for your valuable response.

Firstly, I thought to try IP method but there is an issue that I don’t have static IP.
So, indeed I had to look a solution which can work at client side. So, after some research of more than two months, I found a method which resolved my problem. Credit goes to respective team.

<script type="text/javascript" data-cfasync="false">
// Set to the same value as the web property used on the site
var gaProperty = 'UA-xxxxxx-y';

// Disable tracking if the opt-out cookie exists.
var disableStr = 'ga-disable-' + gaProperty;
if (document.cookie.indexOf(disableStr + '=true') > -1) {
  window[disableStr] = true;

// Opt-out function
function gaOptout() {
  document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
  window[disableStr] = true;

// Google Analytics
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  ga('create', 'UA-xxxxxx-y', 'auto');
  ga('send', 'pageview');

<a href="javascript:gaOptout()">Click here to opt-out of Google Analytics</a>

I hope that someone can find this tips useful.