My boys use a litter tray or go back to the cage when they are roaming the room. I started with pee mats everywhere and when I saw where they preferred to "go" I put the tray there. It's just a cat litter tray with wood pellet litter covered with a big pile of hay. In my opinion there are no suitable litter trays for piggies as the ones marketed can damage their delicate feet and, if used as advertised, would be very uncomfortable.
Dignified Sir George is very tidy about his toileting and he taught Mischievous Master Boris to use the tray. However, when in the cage Master Boris pees and poops everywhere whereas Sir George is very fastidious and makes tidy piles. He uses two corners, one upstairs and one downstairs and the hay tray in the cage.
It seems to be very individual and somepigs (yes Master Boris, I am looking at you!) seem to like sleeping in their potty mess.