Clean the carpet with a cleaner that has enzymes to remove all odor such as Odor Mute, Simple Solution, Nature's Miracle etc.
Try putting a cat box in the favorite spot and slowly move it (no more than a foot a day) to an space you don't mind having the box.
Try a different type of litter - something that will feel more like the rug or put a thin layer of litter over a rug sample in a second litter box to see if that works.
You may find that she has a tummy problem - check her for parasites as that might make her need to go suddenly as could a food allergy/sensitivity. A change in food to a high quality one if you feed grocery store foods may help.
You might find Feliway cat appeasing pheromone helps. You can get it in pet supply stores and online.
You could buy or borrow a dog crate - a big wire one to set up as a cat condo so she has no choice but to use the litter box provided. Keep that up until she is habituated to that spot alone.
But do check for medical issues. Its not uncommon for a cat with parasites or food allergies to potty in places they should not.
Hope this helps you!
__________________
Please press Accept if you find my answer helpful. Want more info? Just reply on your question!
Bonuses for good work are always appreciated!
Thanks for the opportunity to help you!


