ListenBrainz keeps track of music you listen to and provides you with insights into your listening habits.
We're completely open-source and publish our data as open data.
If you use Last.FM, you can import the data into your listenbrainz account. Listenbrainz also has Spotify integration.
Thing is you need 3rd party tools to "scrobble" or send the data to ListenBrainz.
MusicBee has a plugin for ListenBrainz.
And on Android I use PanoScrobbler