How google tracks me without using mobile my internet data plan? : I'm developing an app that can shows all the bus lines in my city, i'd like to show if the bus is crowed or not, and even get the bus position by another user that is inside it.

But I don't want to use all the internet plan from my users, i see that google does that, he know when a restaurante or bar has people there, knows if a street is congested, and also get your path history.

I'm not asking for all the code, but kind of how does google does that?