Does anyone know if/where I can find IP addresses of my visitors in Google Analytics Universal reports?

  • 2
    You shouldn't be able to. – Osvaldo Feb 17 '15 at 17:05
  • You could try this or you should be able to track ip addresses by collecting them with javascript and set them as "variables" in GA js code. – machineaddict Mar 10 '16 at 8:21
  • You could also use Statcounter which does track the user's IP address. – user71607 Nov 2 '16 at 15:43
up vote 17 down vote accepted

No, you won't be able to find that info. GA doesn't make it available in your reports due to privacy issues, and any collection of it is in violation of Google Analytics' Terms of Service. Please read Google's Analytics usage guidelines for clarification.

[Update July 26, 2016]

IP collection through GA is a grey area in that there is no right or wrong. It will, however, require due diligence in the investigation with your privacy lawyers/experts or into the jurisdictions of your locale (eg. European privacy laws). Alternatively, you could always make it non-argument by setting the last octet of your addresses to 0. This would sufficiently make it anonymous.

  • 2
    Thanks. I have checked and google is collecting IP address but does not allow us to see it. Google uses it to get visitor location etc – zachu Feb 18 '15 at 9:45

You can't do it via Google Analytics. However, you can setup your GA account so that each user is assigned a User-ID so that you can track each user with more detail if thats what you are looking to do. Note: this will require some change within your account and from privacy perspective this can be a real pain as well.

Or if you simply want to find the IP addresses that make requests to your site then you can check your server log. That log will list every IP address.

  • 2
    Can you explain how to do this? – ignacio chiazzo Dec 10 '15 at 18:31

Here are the instructions to view IP addresses in Google Analytics.

  1. Add the following code to your pages, before the traditional Google Analytics code:

    <?php 
      if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
      $ip=$_SERVER['HTTP_CLIENT_IP'];}
      elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
      $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];} else {
      $ip=$_SERVER['REMOTE_ADDR'];}
    ?>
    
  2. Then add this code to your webpages before </body>:

    <script type='text/javascript'>
     _gaq.push(['_setCustomVar', 1, 'IP', '<?=$ip;?>', 1]);
    </script>
    
  3. To see the data:
    1. Create a report in "Custom Reporting".
    2. Select Custom Variable (Value 01) as first dimension.
    3. Select all the web metrics you want to see (visits, pageviews, time on site, etc.)

Voilà!

  • 6
    As @nyuen answered, sending personal information (like names, email addresses or any similar data like IP addresses) to Google is prohibited. Doing so is against their terms of service and could result in your account being terminated and your data destroyed. – Ronald Jul 26 '16 at 15:12

Tracking user IPs wouldn't be to beneficial to the overall product that Google is trying to deliver.

You can however find the IP's within the Apache (or IIS) log files though. Then you can take those IP's and create filters.

This article outlines the process but is specific to RFC 1918 addresses, but that's not a requirement of the filter. Not sure if it accepts CIDR notation either but worth looking into.

protected by Community Jan 12 '17 at 21:38

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.