0

Based on Google Documentation, the Activity that is returned by Reports API, should contain ipAddress:

ipAddress (string)

IP address of the user doing the action. This is the Internet Protocol (IP) address of the user when logging into Google Workspace, which may or may not reflect the user's physical location. For example, the IP address can be the user's proxy server's address or a virtual private network (VPN) address. The API supports IPv4 and IPv6.

But I've noticed that sometimes it does not return ipAddress inside Activity payload at all (so there is no even key ipAddress inside the payload). I thought it could be related to Anonymous users, but it's not, I have events where the actor is a specific user but there is still missing ipAddress.

Any idea why? And how can I be sure to get ipAddress always?

  • I cannot reproduce this, it's returning `ipAddress` for all items that are returned. Are you specifying you want to return `ipAddress`, using the parameter `fields`? Otherwise I don't think it will be returned. If that's not the issue, can you see any pattern related to when the `ipAddress` is returned and when it's not (certain `applicationName`, certain user, etc.)? – Iamblichus Mar 08 '21 at 08:36
  • thanks, @lamblichus. I don't use `fields`. And even if I specify `fields` explicitly: client = build('admin', 'reports_v1', credentials=cred) result = client.activities().list(userKey='all', applicationName='drive', eventName='view', fields='items(kind, ipAddress, actor)').execute() It does not return ipAddress for some records. I didn't find any pattern, it occurs even for the same user, so one activity has ipAddress, the next one, for the same user, does not. – Emil Temirov Mar 08 '21 at 14:34
  • I cannot reproduce this behaviour. Does this happen only with `drive`, or with any application? – Iamblichus Mar 09 '21 at 09:38
  • @Iamblichus, I've just checked, I have the same issue for the following apps: token, meet, and calendar. For some apps, I do not have events coz they are not used. It looks like it is not related either to the application or the event itself. Is it possible that Google cannot get IP from the request for some reason? Anyway, It's weird because I have this issue even for my user, first event at 2021-03-05T12:51:17.296Z has IP, the next one at 2021-03-05T12:51:27.934Z - does not, just 10 seconds later, I used the same network. – Emil Temirov Mar 10 '21 at 14:04
  • Do you have access to Workspace support? If that's the case, I'd suggest you to contact [them](https://support.google.com/a/answer/1047213). Also, if you find a way to reliably reproduce this with any account, consider filing an issue in Issue Tracker, using [this template](https://issuetracker.google.com/issues/new?component=191635&template=823904). – Iamblichus Mar 10 '21 at 14:48

0 Answers0