If I use a gift card to purchase an item and later sell the item at a profit do I include the gift card amount as the cost basis?

Let's say I used an Amazon gift card to purchase a product for $20. A few years later I sold it for $40. It's now a capital gain.  Should I put as the cost basis $20 or $0? Since technically $0 came out of my bank account. I think it should be $20 right? I mean it's no different than someone gifting me cash and using it to buy something.