Is the carpeted area newer to her than elsewhere? You said she is peeing and pooping quite well in her tray until she gets onto the carpeted area, if the carpet is a newer area to her, she may still feed the need to mark it as her territory.
Another option is that some rabbits simply like to pee on soft things, and the carpet is one of those things. One way around it is to restrict her play time to a playpen attached to the front of her cage. In this playpen you can cover the carpet with a single piece of something like linoleum which extends under the bottom of the playpen so that she cannot dig it up. This will keep her from having access to the carpet, make messes easy to clean up, but will also provide her with more room than just her cage.
Otherwise, as mentioned, the thing that is most likely to help is getting her spayed. It really needs to be done and should help a great deal with her litter training, she is also still very young, at 4 months she is a teenager, and hormones are going crazy, once she grows up a little more and settle down, you may find that she is more consistent with the tray, but it’s no guarantee.
What is her cage setup and litter tray like? How often do you clean the tray?