Can a Canadian eTA be used for transit purposes?

If you are from a visa-exempt country and you are going to transit through Canada by air then you can use an eTA. If you are transiting through Canada entering by boat or land then you do not require an eTA. You will need to take the revelant travel documents with you though.
If you are from a visa-required country then you will need a transit visa to enable you to transit through Canada by air if you do not have a valid visitor visa. If you are staying in Canda for over 48 hours whilst transitting then you require a visitor visa (unless you are visa-exempt and have an eTA). If your stay is for less than 48 hours then a transit visa is adequate.