In a hangout, one SEO professional asked John Mueller about structured data and using it with Google Tag Manager.
Their question was: Is adding Schema markup with Google Tag Manager good or bad for SEO, and does it affect ranking?
John answered that, first of all, you absolutely can add structured data with Google Tag Manager. This is an option.
For the most part, Google is able to process this normally, and the structured data that you generate like this, it can be countered, just like any other structured data on your web pages.
From Google’s perspective, structured data, at least the types that are documented, are primarily used to help generate rich results.
Rich results are the types of “fancy” search results that have a bit more information, and more color and detail surrounding your pages.
If you add your structured data using Tag Manager, this is not a problem.
From a practical point of view, however, John prefers to have the structured data directly on the page or directly on the server, so you know exactly what is happening with this code.
This makes it a bit easier to debug things, and it makes it easier to test things. Trying out Tag Manager is perfectly legitimate, John says, and it’s an easy way to try things out.
But, in the long run, John recommends that you add structured data to your site directly, rather than using an external tool like Tag Manager.
This happens at approximately the 12:30 mark in the video.