Learn business growth with Google Analytics 4 Forums Google Analytics 4 . Can I create a random `client_id` for GA4 events if `user_id` is already included? Reply To: . Can I create a random `client_id` for GA4 events if `user_id` is already included?

  • Aiden

    Member
    25 May 2023 at 10:39 am

    Okay, here’s the interesting thing I’ve found. It turns out Google Analytics (GA) doesn’t play nice with a randomly generated client_id. If you try to send two events to GA’s Debug View, one with a legitimate client_id (think something along the lines of xxxxx.xxxxx) and another one with a bogus random client_id, only the one with the real deal pops up.

    Looking again at GA4’s Measurement Protocol (MP) documentation, it appears client_id is a non-negotiable requirement while user_id is optional. This means you can’t skip sending a client_id. But, it seems unusual to me that GA isn’t cool with custom client_id. Looks like there’s still a bit more investigation needed on this topic!