-1

Hi guys am not getting the list of ip's who are visited my website even though i included below JS code to my website

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-812xxxxx-x', 'auto');
ga('send', 'pageview', {
  'dimension1':  '<?=$ip;?>'
});

  • 2
    Custom dimensions do not show up in standard reports by default. You either need to select them as secondary dimension, or create a custom report. – Eike Pierstorff Jul 25 '16 at 11:38
  • Do not violate the **[Google Analytics Terms of Service](https://www.google.com/analytics/terms/us.html)** in regards to collecting Personally Identifiable information! "You will not and will not assist or permit any third party to, pass information to Google that Google could use or recognize as personally identifiable information." – Matt Jul 25 '16 at 17:10
  • Thanks a lot matt and eike pierstorff – Premchand kar Jul 26 '16 at 03:14

1 Answers1

2

[Posting this as an answer for visibility as I think it's a great question with not just one answer.]

You might want to reconsider storing IP addresses in your GA data and do some more investigation as to whether or not, by doing so, you are violating Google Analytics terms of service. It's a grey area and will require due diligence in the investigation with your privacy lawyers or into the jurisdictions of your locale. Alternatively, you could always make it non-argument by setting the last octet of your addresses to 0. This would sufficiently make it anonymous.

Matt
  • 5,028
  • 2
  • 28
  • 55
nyuen
  • 8,829
  • 2
  • 21
  • 28
  • 1
    For the Europeans on SO, in Europe IP addresses are considered PII and storing them in GA would be against EU regulations (and by extension against national laws) since you must only store PII after obtaining a users consent, only to the extent necessary to conduct your business and you must be able to remove the data if the user in question demands it (which obviously would not work with GA). – Eike Pierstorff Jul 26 '16 at 09:20