Clean with enzymatic cleaner and give a refresher from the beginning. Blocking her access to the rug might be a good interim stop gap. By chance, did you use potty pads for house training? If so, she might be thinking the shag rug is a giant potty pad from the past.
My opinion is the best thing to do is clean it VERY thoroughly, which means using special cleaners designed for the job. And then, get a black-light flashlight and turn the lights off and shine it on the area. It will show you where you have to clean even more thoroughly.
Block the dog's access to the rug for at least a month, if at all possible, because dogs can detect smell that are minute, and there still could be something left there even after cleaning. After a month or so of not even being able to go onto the rug, she may not repeat it. If you cannot block all access, then keep a very close eye on her when she is on the rug, and don't give her access to it when you are not home.
A suggestion: try not to be angry with her. She didn't do it to upset you. Sometimes a dog will think they should pee on something that is new and different and smells strange. Make sure that you don't punish her for this, because she won't understand and it may only make the problem worse.
This is something a person can always try, of course. Maybe there is one that actually works.
I have never had any success with this sort of thing, though, and would caution that it's best not to rely on this, especially if the area has already been soiled. Removing ALL of the smell and then controlling the dog's access to the area is the most important thing.