Google Tag Manager schema: structured data via JavaScript
Google Search can read structured data that exists in the page when it renders it, so markup added by JavaScript works; the common routes are Google Tag Manager and custom JavaScript, with server-side rendering as another choice.
What it means for your Maryland business
Google Tag Manager schema means using Tag Manager, a Google tool for managing tags on a site without editing its code, to insert structured data that describes your pages to Google. It works because Google reads the page after running its scripts. It's a practical route for Maryland businesses whose site platform makes code edits hard: restaurants on template builders, franchise locations with locked corporate sites, real estate agents on hosted platforms, and small firms whose developer is no longer around.
Staff at a Columbia cooking school can't edit page code, because the site builder won't allow it. Using Tag Manager, a marketer adds a Course or Event block to each class page, with variables that pull the class title, date and instructor straight from the page so the markup always matches what visitors see. Testing each live page by URL in the Rich Results Test confirms Google picks it up. If the school later sells knives and cookware online, it should ask about building Product markup into the page itself, since Google warns that script-generated product markup can make Shopping crawls less frequent and less reliable for prices and stock.
Typing values into Tag Manager by hand lets markup drift out of date when the page changes. Testing pasted code instead of the live URL misses how the script actually runs, and firing tags on the wrong pages adds recipe markup to a contact page. Keep a short list of which tags add which markup, so whoever manages the site next can find and update them.
In Google's words
“Google Search can understand and process structured data that's available in the DOM when it renders the page.”
What Google says
Google Search can read structured data that exists in the page when it renders it, so markup added by JavaScript works; the common routes are Google Tag Manager and custom JavaScript, with server-side rendering as another choice. In Tag Manager, Google recommends variables that pull values from the page instead of retyping them, to avoid mismatches. For Product markup, dynamically generated code can make Shopping crawls less frequent and less reliable, and Google advises testing with the Rich Results Test's URL input.
Where to go next
The entries on either side of this one in Rich results.
