Under UK law, if you’re entering or transiting through the United Kingdom (Great Britain and Northern Ireland) and go through border control, you’ll need an Electronic Travel Authorisation (ETA) before you travel. But if you remain airside – meaning you don’t pass through UK border control – you won’t need an ETA.
If your trip starts in and goes through border control in the UK, you might need one.