You do not earn points on the part of a purchase paid for with a gift card.
If you pay partly with a gift card and partly using another eligible payment method, you earn points only on the amount paid using that other method. This also applies if you received the gift card as a gift.