This paper proposes 2G, a flexible and energy-efficient data collection protocol for sensor networks for increasing network lifetime. To this end, it integrates self-organizing data aggregation mechanisms based on geographical and cluster-based routing, and transaction cluster-head (TCH). A TCH is a location-based role, dynamically assigned to a node for the duration of handling a request-response transaction that targets its region of the network. TCH nodes collect raw sensor readings from their local regions and forward the answers containing aggregated data using geographical routing. A prototype of 2G was implemented on MICAz motes, and experimental results in realistic conditions proved that data collection reaches significantly higher delivery rates than with GEAR, the geographical routing protocol leveraged by 2G. Additionally, simulation results for larger scale networks demonstrate that 2G outperforms GEAR in terms of network lifetime.