Hey there @Gustafurs, welcome to the community!
Listening in offline mode still gets logged and once you go online the data is automatically sent to Spotify. The data still counts for your top tracks and artists still get paid. 🙂
Artists and record labels would throw a fit if they weren't being logged lol.