In the passé composé (present perfect), what is considered the verb is the whole verb unit: auxiliary verb + past participle. For instance, in je suis allé (I went), the verb unit is suis allé, and so the pronoun goes in front of suis, like this: j’y suis allé (I went there).
Don’t confuse the passé composé conjugated with être or avoir (je suis allé) and the futur proche (near future) conjugated with aller, as in je vais aller (I am going to go). Both are two-word verb forms, but the rule for placement is different for each.
In the following sentence, in futur proche, the verb that has an object is partir, not vais; therefore the pronoun goes before partir.
Je vais partir au Brésil. (I am going to leave for Brasil.) → Je vais y partir. (I am going to leave for there.)
But in the following sentence, in passé composé, what constitutes the verb is suis parti, so the pronoun goes in front of it.
Je suis parti au Brésil. (I left for Brasil.) → J’y suis parti. (I left for there.)