Definitely for the Sagrada Família, Casa Milà, Casa Batlló, and Park Güell, I recommend buying tickets online. This way, you avoid long queues and don't waste time. If you travel during holidays or peak season, it is highly advisable to purchase all your tickets online in advance. The ticket counters can get quite busy, and you certainly want to avoid this during your vacation! Also, all walking and bike tours should be booked well in advance to ensure a spot on your desired day.