The bodge version would be to drop it into your seat tube wrapped in something to stop any rattling (I've used bubble wrap and elastic bands on my road bike which has the canyon split seatpost). It just makes removing it a pain.
Take the seatpost out and turn the bike upside down and give it a shake. That gets it out of my wife's bike which has one wrapped in bubble wrap and dropped down the seat tube.
On mine, where it's internationally jammed down the bottom of the seat tube with some bubble wrap (because ISP), I have a bit of Kevlar string attached to it and stuck at the top of the seat tube. The plug is also at the top, with the wire running past the battery.
The bodge version would be to drop it into your seat tube wrapped in something to stop any rattling (I've used bubble wrap and elastic bands on my road bike which has the canyon split seatpost). It just makes removing it a pain.