The effects that destroy 1 card or return cards to the hand are targeted effects. The effect that distributes A-Counters is not a targeted effect.[1]
The number of A-Counters distributed is based on the number of Spell/Trap Cards actually returned to the hand. If a chained effect destroys a Spell/Trap Card targeted by “Cosmic Fortress Gol’gar” before it is returned to the hand, no A-Counter is distributed for that particular Spell/Trap Card.[1]