Control object yaw by two axis

I’m developing AR application and I need implement custom real-world map (like Google map) which would be controlled just like there. To implement this I decide to set user marker facing direction based on AR camera rotation. It works good when I’m hold my phone vertical and rotate camera by Y-axis. But it works terrible when I turn my phone horizontally. At this moment user marker direction is different from camera Y-axis, and correspond to Z-axis.
The question is: how to implement user marker facing based on Y and Z rotation values of AR camera?

P.S for better understanding I recommend to look on behaviour in “Google Maps” application. Try to hold device vertical and rotate it by Y-axis and than turn your phone horizontal and rotate it by Z-axis. Behaviour of user marker would be the same.

Sounds like you are trying to use global axis and/or global rotation. Did you try to use localRotation instead already?