I’m almost certain that your gift card purchases will count towards your bonus point spend … but the only way to be totally certain is to read through the Terms & Conditions (the fine print) for your particular credit card offer. Each card issuer will have its own T&Cs, and they do differ. So no-one can say for certain whether your spend will count: you need to spend the time ploughing through the T&Cs yourself, for your particular offer.
If your card’s T&Cs say something like “eligible purchases do not include gift cards” then you’re out of luck. But if they don’t mention gift card purchases, then you should be OK.
For what it’s worth, I’ve never come across a bonus point offer that excludes gift cards – but that doesn’t mean they don’t exist. There’s no alternative: you’ve got to do the homework yourself.