Go to Settings on your iPhone or iPod. Open Music, and the in the next step, turn on use listening history.