Win a gift after 10 purchases of a specific product

Hello guys,

I’m trying to setup a way to keep track of customers sales, and when one buys 10 products like 10 big pizzas, they win another for free.
But i have no idea how to do this. I’v searched i little bit for it on the forums, and i found this: SambaPOS Loyalty Card Features
its looks the right way to it, but not exactly what i need.
can anyone please give me some direction on my goal ?

Youll need customer entities obviously.
Add a custom field to them to track the qty.
Take a look at this video I did for loyalty points.

If you change out the calculation for points with a count and constrain to the products in question.