Following - a very common method
Following a potential victim before a crime may be committed is a very common method or MO (Modus operandi) used by criminals.
It is really quite logical from a perpetrator's perspective when you think about it. It helps the criminal assess the situation and "test" the potential victim. Also it gives the perpetrator the chance of picking a suitable place to strike.
Tailgating the victim
One such common method of following or stalking a potential victim is to tailgate. In this context, it is to follow on the heels of the victim as she enters a gate or door, and then slip through the same gate or door before it closes.
The following chilling footage from New York city shows a hammer-wielding perpetrator following a woman into a building on Manhattan. He attempted to rape her, but she fought back and fought him off. You can read the story here.
You should be aware of the statistics showing that many assaults happen close to the victim's home, and that the method of following the victim as she enters her home is nothing unusual at all.
In other words, you will need to use your awareness and pay attention to your surroundings as you're about to approach your apartment complex. It is always a good idea to have your keys ready and that you make sure the door locks behind you as you enter.