Starwood's stated policy is that you will not get points or elite credit for the prepaid stay through the discounter. You will, however (always) get points for extras charged to your room or for meals eaten at a Starwood property if the SPG card is presented. Certain contracted services such as parking and movies are excluded.
Most of the time you get an elite stay credit anyway if you charge a significant amount to your room.