How to use Google Tag Manager for SEO optimisation

Google Tag Manager is not just a tool for analysts, it can also be used to help you SEO efforts.

In this advanced guide I am going to show you some implementations of this feature: structured data.


Disclaimer: with this guide you can make the changes on your website in order to show them on Google search results, however only Google decides when and how to show them. So if you don't see those changes, please don't blame me.



STRUCTURED DATA MANAGEMENT WITH JSON-LD


First of all, what are structured data? With so many websites fighting for visibility on top results of search engines, the best thing you can do is to improve your odds with structured data. They don't just allow search engines to capture extra information about your listing, they also take much more space on search engines if compared to a traditional result.


Here is an example:



Structured data markup is essentially a string of code that can be added to a site’s HTML. This code is read by search engines and used to produce augmented search results to specific user queries.


The cool thing about GTM is that you can add the string of code to produce structured data directly into your own GTM tag using customised HTML tags.




1- Optimise your Knowledge Graph


Let's start with knowledge graph. What is this? Here is the Wikipedia definition:


The Knowledge Graph is a knowledge base used by Google and its services to enhance its search engine's results with information gathered from a variety of sources. The information is presented to users in an infobox next to the search results.


As I said above, there isn't a tag in GTM to build a knowledge graph, this means we need to create our own code with customised HTML tags.


Here are the steps:


  1. Create a new Tag > Choose Tag Type > Custom HTML

  2. Copy - paste the scripts I have provided below

  3. Call it "Structured Data - Knowledge Graph"

  4. Activate on all Pages

  5. Save




To check if your tag is working, you should enable the Preview mode and when you see the tag firing as in the image below, it means it's working. Here is the confirmation:



If you are unsure your code is actually working, you can check it with Google Structured Data Testing Tool.


Here is a list of codes to implement your structured data. Before you copy-paste them into your HTML tag, make sure you customise them to your requirements.

For example, URL, logo, contact details and everything else related to your company needs to have the right information. I have put my own information on the cheat codes.





CORPORATE CONTACTS


<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Organization", "url": "http://www.your-site.com", "logo": "http://your-logo.png", "contactPoint" : [{ "@type" : "ContactPoint", "telephone" : "+44-00000000", "contactType" : "customer service", }] } </script>




LOGO


<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Organization", "url": "http://www.your-site.com", "logo": "http://yourlogopng" } </script>




SOCIAL PROFILES


<script type="application/ld+json">

{

"@context": "http://schema.org",

"@type": "Person",

"name": "your name",

"url": "http://www.your-site.com",

"sameAs": [

"http://www.facebook.com/your-profile",

"http://instagram.com/yourProfile",

"http://www.linkedin.com/in/yourprofile",

"http://plus.google.com/your_profile"

]

}

</script>




CAROUSEL


<script type="application/ld+json">

{

"@context":"http://schema.org",

"@type":"ItemList",

"itemListElement":[

{

"@type":"ListItem",

"position":1,

"url":"http://example.com/desserts/apple-pie"

},

{

"@type":"ListItem",

"position":2,

"url":"http://example.com/desserts/cherry-pie"

},

{

"@type":"ListItem",

"position":3,

"url":"http://example.com/desserts/blueberry-pie"

}

]

}

</script>




2. Breadcrumbs


Also your breadcrumbs can be managed from GTM.




Here are the steps:


  1. Create a new Tag > Choose Tag Type > Custom HTML

  2. Copy - paste the scripts I have provided below

  3. Call it "Structured Data - Breadcrumb"

  4. Activate on all Pages

  5. Save


<script type="application/ld+json">

{

"@context": "http://schema.org",

"@type": "BreadcrumbList",

"itemListElement": [{

"@type": "ListItem",

"position": 1,

"name": "Books",

"item": "https://example.com/books"

},{

"@type": "ListItem",

"position": 2,

"name": "Authors",

"item": "https://example.com/books/authors"

},{

"@type": "ListItem",

"position": 3,

"name": "Ann Leckie",

"item": "https://example.com/books/authors/annleckie"

},{

"@type": "ListItem",

"position": 4,

"name": "Ancillary Justice",

"item": "https://example.com/books/authors/ancillaryjustice"

}]

}

</script>



3. Site-link search box


The search box is your website search bar that shows up in SERPs, to allow users to search within your site directly from search engines results before users visit your site. Also this feature is set up with JSON and with a custom HTML Tag.


Disclaimer: again, as said before, we can set up the search box with GTM but we cannot control its publication on search results. This is entirely up to Google.





Here are the steps:


  1. Create a new Tag > Choose Tag Type > Custom HTML

  2. Copy - paste the scripts I have provided below

  3. Call it "Structured Data - Site Search"

  4. Activate on all Pages

  5. Save



This is the script you need to add:


<script type="application/ld+json">

{

"@context": "http://schema.org",

"@type": "WebSite",

"url": "https://www.example.com/",

"potentialAction": {

"@type": "SearchAction",

"target": "https://query.example.com/search?q={search_term_string}",

"query-input": "required name=search_term_string"

}

}

</script>



These are some actionable guides on how to implement structured data. After you have done your job on GTM, all you need to do is wait for search engines to crawl your website and the job is done.

© 2020 by Luca Tagliaferro. All rights reserved.