I need to obtain a COUNTA of column G if column B = matching text

B G

GSM 20
HAA 10
GSM 10
HAA 20

I need a cell for GSM to = 2

I do not need to sum column G just count the instances.
I have tried COUNTIFS but it is coming up with too few calculations