0

We are currently not collecting User IDs and enabled the GA IP anonymization.

So how can we delete the user's identifier Client ID?

https://developers.google.com/analytics/devguides/config/userdeletion/v3/reference/userDeletion/userDeletionRequest#resource

By looking at the script it seems that it requires the User ID so i believe that if we don't store User ID in our GA system then there is no way of achieving it right?

CodeDoctor
  • 62
  • 1
  • 7

1 Answers1

2

The JSON object should change based on the type, you have 3 options: enter image description here

So if you want to delete a Standar Web Property:

{
  "kind": "analytics#userDeletionRequest",
  "id": {
    "type": "CLIENT_ID",
    "userId": "188309123.12312312" // This is an example
  },
  "webPropertyId": "UA-XXXXX-X",   // Property attacked
  "deletionRequestTime": datetime   
}

Greeting

Kemen Paulos Plaza
  • 1,560
  • 9
  • 18
  • Thanks For Answer nice and clear! Got another question where would this piece of code would go? I believe it needs to be automated as we (website operators wouldn't know) which user has which Client ID? – CodeDoctor May 23 '18 at 10:39
  • Yes, will vary on the user case, but a good option is when the users ask for removal his personal data attach on that request the client id reading the _ga cookie. When you have this automatice this via Java, Python or whatever is behind this to send the request to the https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests with the body(JSON). I didn't see any library yet, so this needs to be managed by you. – Kemen Paulos Plaza May 23 '18 at 16:00
  • If we do not attach client id with users' account then i think we do not have to worry about it right? As we would not be able to identify which users has which client id. Thanks – CodeDoctor May 31 '18 at 12:31
  • Just to add another complication, one user might have a number of clientids (if he had multiple devices, or deleted his or her cookies), so deleting all data for a given user by clientid most likely isn't even possible. – Eike Pierstorff Jun 04 '18 at 09:52