I am bit confused about precedence of A and B in below sentence patterns
AついでにB
AがてらB
AかたがたB
Aを兼ねてB
In structure「Aを兼ねてB」, B is a main goal and A is a subsidiary goal according to this page.
Based on my knowledge, in「A (ついでに / がてら / かたがた) B」structure, A is a main goal and B is a subsidiary goal. However when I look up がてら from the same grammar website, it said that がてら is synonymous to both を兼ねて and ついでに which is contradictory to me. Does it imply that B is a main goal while A is a subsidiary goal in both「AがてらB」and「AついでにB」?
What is true precedence of A and B in「A (ついでに / がてら / かたがた / を兼ねて) B」sentence structure?