Here is the hypothetical situation:
I am playing a hunter with a tyrannosaurus. I have taught this animal companion several tricks, one of which is the following Skirmisher trick.
Upending Strike: The ranger(animal companion) can use this trick as a free action just before he makes a melee attack. If the attack hits, he may make a free trip combat maneuver against the target.
The tyrannosaurus also has the grab special ability
Grab: If a creature with this special attack hits with the indicated attack (usually a claw or bite attack), it deals normal damage and attempts to start a grapple as a free action without provoking an attack of opportunity.
If the Tyrannosaurus successfully hits with a melee attack on his target, which applies first, the grab or the upending strike?
Both of these abilities grant trigger on the hit, and are free actions. I feel like it can be whichever you want to apply first, but would love some feedback.
RAW, you trip them then get the grab as part of the attack.
You don't get the bonus to attack against the prone enemy- as they are still "falling" down from your trip.
Though, it could also be entirely the opposite, as your base attack abilities may take priority over secondary abilities. Still, if you grab fails, you still get the trip attempt.