This may not work if you use a massive trash can but we use a small sized one for which the grocery bags are a perfect fit.
This not only helps us save some money, but reduces our environmental foot print and avoids the kitchen from stinking from a huge overflowing trash can.