We establish the general machinery of string topology for differentiable stacks. This machinery allows us to treat on an equal footing free loops in stacks and hidden loops. We construct a bivariant (in the sense of Fulton and MacPherson) theory for topological stacks : it gives us a flexible theory of Gysin maps which are automatically compatible with pullback, pushforward and products. Further we prove an excess formula in this context. We introduce oriented stacks, generalizing oriented manifolds, which are stacks on which we can do string topology. We prove that the homology of the free loop stack of an oriented stack and the homology of hidden loops (sometimes called ghost loops) are a Frobenius algebra which are related by a natural mo...