Registering process in gproc in global mode?

I am trying to register process with gproc and I am having problems when I do {:via, :gproc, {:n, :g, {:user_cart, user_id}}}, I get error: {:error, {:already_started, :undefined}}. however if I am using :l instead of :g everything works fine. I’ve tried to find resources online but couldn’t find much information, I am thinking maybe I need to configure my application in a certain way for gproc to work in a distributed way? please help.