Personally, for the purposes of calculating insulin doses, I count the carbs. So product 1 has 20g of carbs and product 2 has at least 18g of carbs. (You haven't said whether product 2 has additional carbs other than the 18g sugar).
If by "weighs the same", you mean that product 2 has the same total amount of carbs, then I'd give the same amount of insulin for both.
(But I might reckon that product 2 is likely to have a higher glycemic index than product 1, so will spike my blood sugar higher before the insulin brings it down?)
Having said that I am T1 and not T2 and so all my insulin is injected. As a T2 you may or may not still be making some of your own insulin and so I don't know if that affects your insulin calculations.