I’m thinking of multitasking my lvl 7 ninja with lvls in magus to get spell strike. Do my ninja lvls count towards the caster lvl of shocking grasp or do only the magus lvls count?
A Ninja doesn't have a spellcaster level and the Minor or Major magic talent don't give it. It only give a spellcasting level for some specific SLA. So only the levels in Arcane spellcasting classes count.
Just those in the magus class. Caster levels in PF almost never stack, and a ninja doesn't even have a caster level outside of spell-like abilities so there's no chance at all.