Has she been to the vet and checked to see if she has a urinary tract infection or anything?

How old is she?

Have you tried, for example, keeping her in one room - where the litter box is? Even shutting her overnight in the bathroom, with a few toys ...

There's stuff you can buy at any pet supply place that cleans carpet better - it has enzymes that break down the stuff that causes the smell. Until the smell is gone, she may continue to think that's a fine spot to do it.