what is the best way to potty train an 8-month old dog when you live in an apartment building on the 4th floor?

We rescued her from a shelter where they told us she was housebroken, and while she only has one accident every so often, it's clear she isn't.
We've thought about getting the bells to put on the door but I'm worried it won't be effective because we're on the 4th floor of an apartment building and "going outside" means exiting the front door, walking to the elevator or stairs, going down and then finally going outside.
I'm just trying to explore my options and hear from people who have been successful in this situation.
Thanks!