How to Implement JSON-LD
-
Hi,
I was implementing JSON-LD via Google Tag Manager but have since read that it is better to place directly on the web page.
My questions are:
-
Where exactly do you add the JSON-LD - I mean physically? This article by Moz says the head or body. Does it matter where in the head? At the end?
-
If you do not have development access- is there an easy way to insert?
-
Can you view the added JSON-LD directly on the web page after you have added it or is it not visible in the source once you have added it this way ? If you cannot see it, how do you view? Or it it just OK to use the Google Structured Testing tool as evidence that it is being seen by Google?
Thanks
-
-
Thank you.
-
For Wordpress, it depends if you have it set to filter out script tags from content. So, if you toggle content editing mode to html, and put in a script tag, whether it allows this or not. That is a setting in Wordpress. If it is filtering out your script tags, and if you don't want to (or can't) disable the script tag filtering, then using a plugin to administer the schema markup would be your best bet. There are generic plugins to insert script tags. And there are more specific plugins for schema markup, like Yoast (and others).
If you are inserting the scripts through GTM, then you may not see them when you simply "view source". With tag managers, you will see their container in the source code, but not the injected scripts. But if you instead use Chrome Developer Tools (right click and choose "inspect"), on the elements tab you will most likely find the injected scripts.
-
Thanks for the great response.
For question 2)
If your CMS is Wordpress and you don't have development access, how do you add the script? I'm assuming that the page is a static page. You basically just paste it into the page?
For question 3)
Could you explain why you can't see the asynchronous script in the source code. I'm not overly sure about this part and I'd like to understand it a bit better. When I used Google Tag Manager I couldn't see the script and I don't understand why not. Are you able to explain technically what happens with injecting it via GTM versus on the page itself?
Thank you
-
In answer to your questions:
1. You can place the JSON-LD in either location. If you are making use of data which may not be available at the beginning of the page load, then you might prefer to place at the very bottom of your body tag. But both locations work if you are simply inserting static content.
2. If you are using a CMS, you can simply insert the script as static content (as long as your CMS allows you to insert a script). This is assuming your page is a static page, not one which dynamically changes based on some server-side application. So, for example, if you have an article page on your site, and you want to insert schema to mark up that article, then this would be straightforward to do by simply inserting a script. But if your site is an e-commerce site and you are wanting to mark up all of your product details pages with product information, then this might be better done as part of the application. For static markup, if you search for "json ld generator" you will find some handy tools to simplify creating static scripts. Just be careful that you do not use static markup on a dynamic page where the page content might change based on application data, then causing inconsistency between your markup and the actual page content.
3. If you insert through your CMS, then yes you should see your script in the source code. If you use an ansynchronous script to inject your JSON-LD, then you might not see it in your source code, but could still see it by using dev tools inspect, after the page finishes loading. Either way, then use the Google Structured Data Testing Tool on the live URL to confirm that Google is able to parse the markup properly, with no errors. When you do that, look at its results to make sure the hierarchy of the data looks appropriate to you based on the data you know is on the page.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Hreflang tag implementation
Hi Mozzers, For an international client, we want to install hreflang tags for 3 different languages for their website in Belgium: dutch, french and english. The dutch version (nl-be) and the french version (fr-be) can perfectly be installed, but our developer has troubles implementing the english version (en-be). According to ISO 639-1 , "en-be" is apparently not supported. Unfortunately, we can't generalize the hreflang tags (), because our client has different websites in each country, so we need to specifically target Belgium here. Does anyone have a solution? Thanks,
Technical SEO | | WeAreDigital_BE
Jens0 -
Implemented google adwords via tag manager do it still require to paste script at thank you page?
Hi All Experts, I have implemented google adwords with tag manager, so now query is still it is required to place the google adwords scripts at thank you page?
Technical SEO | | varo0 -
Why is Coyscape showing content duplication error even after implementing 301 redirect ?
We are maintaining the corporate website of one of our prestigious clients "FineTech Toolings" (http://www.finetechtoolings.in). Recently I had raised a question regarding "2 websites running paralley in 2 diferent domains, i.e. 1 organisation having 2 different websites on 2 different domains". Recently my domain changed from http://www.finetechtoolings.co.in to http://www.finetechtoolings.in via 301 redirect, but still I am facing content duplication issue as per Copyscape. Hence I am having a small doubt regarding the same. Please note the following question very carefully and provide me the exact problem and the solution for the same: Even though I have implemented 301 redirect (http://www.finetechtoolings.co.in is redirected to http://www.finetechtoolings.in), which is completely ok as per the SEO rules, why is copyscape still showing that duplicate content exists in the former website? I think I am clear enough with my question.
Technical SEO | | KDKini0 -
I cannot find a way to implement to the 2 Link method as shown in this post: http://searchengineland.com/the-definitive-guide-to-google-authorship-markup-123218
Did Google stop offering the 2 link method of verification for Authorship? See this post below: http://searchengineland.com/the-definitive-guide-to-google-authorship-markup-123218 And see this: http://www.seomoz.org/blog/using-passive-link-building-to-build-links-with-no-budget In both articles the authors talk about how to set up Authorship snippets for posts on blogs where they have no bio page and no email verification just by linking directly from the content to their Google+ profile and then by linking the from the the Google+ profile page (in the Contributor to section) to the blog home page. But this does not work no matter how many ways I trie it. Did Google stop offering this method?
Technical SEO | | jeff.interactive0 -
Best Implementation of a Title Tag
If My Targeted keyword are: Mussoorie Hotels Hotels in Mussoorie Mussoorie Resorts Resorts in Mussoorie What of the below 3 will be the best Title Tag After Panda and Penguine ? Hotels and Resorts in Mussoorie Mussoorie Hotels | Mussoorie Resorts | Luxury Budget & Economical Accommodation in Mussoorie Mussoorie Hotels, Mussoorie Resorts, Hotels in Mussoorie, Resorts in Musoorie please suggest!
Technical SEO | | WildHawk0 -
How do i implement event tracking
Hi, Please excuse me for being too simplistic or dumb. I haven't had any experience in Event tracking so far. So, Please help me out I want to track how many persons have clicked on "subscribe for Newsletter" button on website - http://bit.ly/w7iwdh Pls can anyone paste here the code to implement this ?
Technical SEO | | seoug_20050 -
Implementing Schema within Existing CSS tags
In implementing Schema with a site using CSS and containing existing tags, I want to be sure that we are (#1) using the tags effectively when used within a product detail template and (#2) not actually harming ourselves by telling Google that all products are named or described by the SS tag and not actually the product name or description (which obviously could be disasterous). An example of what we are looking at implementing is the following: Old: <ss:value source="$product.name"></ss:value> New: <ss:value source="$product.name"></ss:value> Old: <ss:value source="$product.description">New: <ss:value source="$product.description"></ss:value> Basically, is Schema at the point where the SS tag be replaced (in the eyes of the search engines) with the actual text and not the tag itself?</ss:value>
Technical SEO | | TechMama0 -
How to implement a temporary splash page?
Hello - Our company will soon be launching a major product enhancement and we have discussed using a splash page when a visitor hits our homepage to promote the launch. I'm thinking something similar to what Apple did on Apple.com to announce addition of The Beatles catalog ot iTunes. I've never actually implemented anything like this before and wanted to get feedback from the community on how best to handle this from an SEO perspective. Thanks, Jason
Technical SEO | | TKSearchGuy0