Once upon a time, I had a boss who would often describe my ideas as “bleeding edge”. I never much liked the description, because — frankly — it sounded disgusting. However, the term is meant to describe something a step beyond the cutting edge. An idea or strategy “so new and untested as to be potentially unreliable and carry a higher risk-to-reward ratio.” I’m not sure that applied to much of what I was doing back then in 2014 (well, there were a few things) but it certainly applies to this.
You’ll want to apply “potentially” and “theoretically” qualifiers to pretty much everything in this post. I think it’s worth taking action on this, but the benefits are as yet unproven. Note that, contrary to the definition of “bleeding edge” above, I think the risk here is almost non-existent while the potential upside is high.
Without further ado…
Let’s talk about machine-readable entity IDs in search and how to use them to your great advantage. Read on for more on the why and the how, and to get your free bookmarklet, too!
What is a Machine-Readable Entity ID?
In the world of semantic SEO, we talk a lot about entities. But there’s a significant distinction between plural “entities” and a single “named entity”. The former refers to people, places, or things more generally and the latter refers to one specific entity (like a single person or place or landmark).
The best way of referring to a named entity is to use a machine-readable ID. A machine-readable entity ID is, in essence, a string of characters used to exclusively refer to a single entity. These have predominantly been alphanumeric (numbers and letters) but don’t have to be.
Freebase/Metaweb, which Google acquired in 2010, was the first notable site to assign machine-readable IDs to entities.
But why is this significant?
With named entities, minimizing ambiguity is extremely important. What would happen if our names for “named entities” weren’t unique? It doesn’t take a stretch of the imagination to see how this is problematic. There are countless examples of companies sharing the same name (there are a few UpBuilds, BTW). And what about names of people? Yeesh.
If someone says “Mike Arnesen” to you — wonderful reader of the UpBuild blog that you are — you might immediately think of “Mike Arnesen, the SEO”. However, go ahead and mention “Mike Arnesen” to someone walking the streets of Dover, New Hampshire and they’d be more likely to think “Mike Arnesen, the chef who used to own Rebel Chef cafe”. We’re clearly two different people, but if we were only described as a “named entity” in human language, there would be a conflict. Ambiguity would arise!
::boo hiss::
In case it’s not obvious by this point, a machine-readable entity allows an entity to be named without any risk of confusion. People speak is flawed, so it’s best to get away from it. It would be much safer to use a system that uses 100% unique identifiers expressed as an alphanumeric string. So that’s what we have. Machine-readable entity IDs, like:
/m/0qs4dyq
Machine-Readable IDs in Google Search
As of the time of writing, Google seems to be issuing two variants of MREIDs. Thanks to Aaron Bradley for his help in clarify the differences between the two.
1. MREIDs for Freebase Entities: This class of entity IDs is reserved for named entities that were discovered and registered in the era of Freebase.
- Format: /m/[a-z0-9]+
- Example: /m/02nt25s for Bill Slawski
- Example: /m/0qs4dyq for Mike Arnesen
- Example: /m/01d3qq for the Kookabura bird
2. MREIDs for New (Post-Freebase) Entities: This class of MREIDs is used with entities that Google has picked up since Freebase went read-only. You’ll see new notable entities use the /g/ format, as well as entities that may not be truly notable (per something like Wikipedia’s standards), but are still entities that Google wants to track (e.g., Google My Business listings).
- Format: /g/[a-z0-9]+
- Example: /g/11dymg249k for Virtuous Pie (Pizza place in PDX)
- Example: /g/1tfkqg96
Note: What if an older entity also has Google My Business page. For example, a notable local business like the Javits Center in New York? The freebase-era Entity ID is given precedence, i.e., /m/ is used rather than /g/.
As an interesting aside, Google is also creating a machine-readable entity ID for specific events. Note that it only seems to do this when they’ve been able to extract structured data from a site pertaining to that event and bring that into the Knowledge Graph (/g/11f55bxvp_ for SearchLove Boston and /g/11f55c40b3 for MozCon).
According to Bill Slawski — and thanks to his tireless work analyzing Google Patents, plus, generally paying more attention than anyone else — we know that Google is using MREID across many services like Google Trends, Google Lens, and Google Reverse Image Search (to keep track of entities within images).
Does that blow your mind? It should!
That means that this unassuming ID, /m/01d3qq, is being used to refer to the same entity across the entire Google universe! It identifies the Kookaburra bird in the Knowledge Graph, Google Trends, Google Image Search, and everywhere. That’s incredibly powerful.
Associating Yourself With an MREID
Back in 2013, Google introduced something called “invisible sameAs”. HT to Barbara Starr for pointing this out in relation to semantic SEO (she actually pointed it out to Bill Slawski, who pointed it out to me and spawned the idea for this post).
The “invisible sameAs” gives you the ability to include the microdata for itemprop=”sameAs” in your HTML as a element. The element is not displayed on the rendered page, making it effectively invisible.
When you consider the technical mechanics of it, it seems rather trivial, but it’s a powerful part of the semantic web. You can, and should, be using this to link to yourself (or your clients) as represented on other trusted websites. If the term “sameAs” sounds familiar, it might be because that’s the property that Google recommends you use to link your website to its corresponding social media profiles, i.e., the same entity represented on a trusted site.
But why?
The same reason that we try so many other things in SEO. To minimize ambiguity and provide engines with deeper and more relevant information for our mutual benefit.
I can’t tell you that this will generate a measurable ROI. I’m writing about this and testing it in the same week, so I just don’t know yet. My theory is that, in cases of uncertainty, it will help Google straighten things and, in all cases, strengthen the semantic connection between websites/content (i.e., strings) to the entities (i.e., things) that they discuss and represent.
Take as much or as little of this as you like, but it’s my belief that we’re going to be ahead of the game here. We’re setting our sights on where Google is going, not necessarily where they are today or have been in the past (which sometimes seems to be the majority of “SEO Best Practices” that get discussed).
At this point, I’m going to assume you’re onboard for trying this out. Let me walk you through two ways to do it.
How to Get Your MREID
Step one is to get your MREID from Google. As an integral part (you could say the integral part) of how Google is tracking entities across their whole universe, you’d be correct in thinking you can find this in a few places. Here are just a couple.
Google Trends: Bill Slawski told me about getting an entities MREID this way. Head to Google Trends and search for an entity. Make sure that the result you get is not a “Search Term” — a search term isn’t really an entity. There has to be a topic or type shown (like “Musical Instrument” below). Once you have that, you’ll be able to see a “q” parameter in the URL. The “%2F”s that you see are encoded forward slashes, so the MREID here is /m/03f5mt.
Wikidata: You can also head over to Wikidata and search for your entity there. If the entity was recognized in the era of Freebase, you should be able to find a Freebase ID on the page.
Here’s the Keytar example.
Google’s Knowledge Panel: This is not only my favorite way to get the MREID for an entity, but I think it’s representative of the importance of this whole discussion. Get this: Anytime that a recognized entity appears in the Knowledge Panel on Google SERP, its MREID appears with it in the markup for that panel!
The easiest way to get at it is by inspecting the “Feedback” option on a Knowledge Panel card. It manifests as the “card_id”. It seems telling that when you provide feedback on the Keytar Knowledge Panel, Google could care less about the query. The information that they ensure is passed along is the MREID!
Free Bookmarklet
All of those options take a bit of work to do, so I’ve done my best to try to simplify my life and yours. The link below is for a Bookmarklet that I wrote that will pull the MREID off of any Google SERP with a named entity on it.
Drag this link up into your bookmarks bar (Chrome works best) and click on it next time you’re on a Google SERP.
You can also take the raw JS code (below) and drop it in the console on a SERP. The bookmarklet is much more satisfying to click.
See the Pen vrXvEo by Mike Arnesen (@mike_arnesen) on CodePen.
If there is a named entity represented on that SERP, the bookmarklet will output the associated MREID to the page along with a link for you to verify using Google Trends.
The bookmarklet will also output the same MREID to the console. You’ll see either this:
Or this:
Pretty neat, huh? I certainly think so.
Adding MREID to Your JSON-LD Structured Data
Adding an MREID to your JSON-LD data array is pretty easy. Just find your existing JSON-LD script tag and add an attribute-value pair.
"sameAs" : "https://www.google.com/search?q=knowledge+graph+search+api&kponly&kgmid=/m/01d3qq"
If you already have sameAs information in your JSON-LD tag, just turn the sameAs into an object with square brackets. In fact, if you also have a Wikipedia entry, I’d recommend doing this so you can link up with both your MREID and your Wikipedia representation.
"sameAs" : [ "https://www.google.com/search?q=knowledge+graph+search+api&kponly&kgmid=/m/01d3qq", "https://en.wikipedia.org/wiki/Kookaburra" ]
“But Mike, what if I don’t have JSON-LD on my site yet?”, I hear some of you saying. No problem. We’ve got you covered. Use this GTM tutorial to get yourself up to speed and then come back here to add in your MREID data.
On the topic of GTM, if you’re going that route you might want to store your MREID as a Google Tag Manager variable rather than putting straight in your tag. It’s a good habit to get into.
Adding an MREID to Your Inline Markup with entityLink.js
This piece is a bit more involved but still fairly straightforward.
I should note that advocating for inline markup seems to contradict UpBuild’s previously published stance, saying that we weren’t going to do inline markup anymore. Well, our opinion hasn’t changed. Writing inline semantic markup is still a righteous pain when you’re an outside consultant and JSON-LD is usually the path of least resistance. Why go through that much pain and suffering if the payoff is minimal?
Well, there’s a way to do this with (you guessed it; I’m predictable) Google Tag Manager that is both easy to roll out and extremely scalable.
Warning: This method and script require that your site is running jQuery. If your site isn’t, A) get on my level or B) let me know that it’s bumming you out and I can work on writing a version of this in pure JS.
Note: If you were so inclined or just aren’t using GTM, you could host entityLink.js on your site as a regular JavaScript file and just call it in the source code as you would any other script. Just be sure to call it after you call jQuery. Doing it this way isn’t my recommendation, but it can be done.
All it takes to get this setup for you to create one new tag in Google Tag Manager. You’ll be copying and pasting code from a script I wrote called entityLink.js and dropping that into a “Custom HTML” tag. Note: you’ll have to wrap the whole thing in script tags.
Here is entityLink.js in all its geeky glory.
See the Pen entityLink.js | MREIDs in GTM by Mike Arnesen (@mike_arnesen) on CodePen.
Before putting it to work for you, you’ll need to make a few slight changes.
- Update the “entityName” variable to be the name of your company or client.
If needed, this could be rewritten as a Regular Expression that would match multiple name variations. - Update the “machineID” variable as well. This will be the MREID that you get using the MREID bookmarklet (see “How to Get Your MREID” above).
- Update the “wikipedia” variable. If you have a page, put it there. If not, just leave the variable blank. If this variable is blank, the Javascript function that does the work will just omit anything having to do with Wikipedia.
Once you’ve made those slight modifications, you can put this in your Custom HTML tag and set up Triggering. You’ll want to set this tag to fire on every page using the Window Loaded event. The “All pages” tag that you’ll likely have in your Google Tag Manager container tag uses the Page View event, which causes your tag to fire before A) all your page content has loaded and B) before jQuery is available.
Save, Preview, and Deploy when ready.
What does it do though?
Good question. I’m glad you asked. Without trying to teach everyone JavaScript, here’s what entityLink.js does on your site.
- Runs through all of the text within paragraph tags on the page.
- Gets all the mentions of the brand name.
- Replaces each instance of the brand name with the HTML below.
<span itemscope itemtype='http://schema.org/Organization'> Brand Name <link itemprop='sameAs' href='https://www.google.com/search?q=knowledge+graph+search+api&kponly&kgmid=yourMREID'> <link itemprop='sameAs' href='yourWikipediaEntry'> </span>
Once you have entityLink.js deployed on your site, run it through the Structured Data Testing Tool and watch it validate!
What Comes Next?
UpBuild will be rolling this out on a handful of sites this month. You can bet that we’ll be watching to see what the impact is and if it’s successful in clearing up problems with entity confusion where they exist. If this discussion resonates with you or if you have an interesting use case for this concept, let me know in the comments.
Until next time. Happy optimizing!
Further Reading & Resources
- Bill Slawski’s Blog, SEO by the Sea
- Image Search and Trends in Google Search Using FreeBase Entity Numbers — Bill’s post with examples of how entity numbers manifest in image search.
- SchemaApp’s Interview with Bill Slawski — on Google Patents and Machine IDs in Google Search
- SMX Advanced 2018 Agenda — Where Bill and I will both be speaking about this (along with Patrick Stox of IBM). Join us for “Advanced Technical SEO: Schema & Structured Data, JavaScript” on Tuesday the 12th at 4:45 PM
I tried and it work smothly
I implemented in JSON-ld for LocalBusiness
Thanks
Luis
Rad! Good luck with it.
That bookmarklet is killer, Mike!
Mind if I modify it for other uses?
Awesome post.
Go right ahead. Any code snippet shown in a blog post on UpBuild is free-to-use and available for you to modify as Free Software per the four freedoms of “The Free Software Definition”. https://en.wikipedia.org/wiki/The_Free_Software_Definition
Freedom 0: The freedom to run the program as you wish, for any purpose.
Freedom 1: The freedom to study how the program works, and change it so it does your computing as you wish. Access to the source code is a precondition for this.
Freedom 2: The freedom to redistribute copies so you can help your neighbor.
Freedom 3: The freedom to distribute copies of your modified versions to others. By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.
I’m looking forward to hearing the results of your experiment! Cheers risk-taker!
Right on!
I noticed that you changed some headings which were like these:
1. “MREIDs for Authoritative Entities”
2. “MREIDs for Informational Entities”
The update looks right to me now. Was that just a correction?
Excellent catch. Cool that you were paying such close attention. 😉
Yes, those headings were indeed updated! Aaron Bradley of http://www.seoskeptic.com/aaron-bradley/ pointed out that there was actually a much simpler reason behind the two formats: the Freebase era vs. the post-Freebase era. Basically, any entity that was given a machine ID prior to Freebase going read-only is /m/ class and everything following that where Google is assigning the machine ID is /g/ class.
For example, a newer movie entity like Deadpool to has been given /g/11cmqkzqvq and the original Deadpool movie received /m/062zn4b. I think this is a cool example because the first Deadpool movie was one of the last /m/ entities to be added. Its Wikipedia article draft was promoted to the mainspace on March 18th, 2015 when filming began, Freebase grabbed the data, and the Freebase then went read-only on March 31st.
very long ago I use this to find ID: https://developers.google.com/apis-explorer/#p/kgsearch/v1/kgsearch.entities.search?query=apple is that different from this?
Yeah, that’s the exact same MREID! I’ve been thinking about how this whole idea could be scaled for businesses that have a lot of entities on their websites and querying the API would probably be the best bet. Thanks for reminding me about that resource.
Hey, great post.
What are the results like?
Really interesting post Mike, so thanks for taking the time to delve into this a little deeper for the rest of us.
it’s a cool idea to use it in the Json LD same as for social I’ve also been adding some of my best citations with maps there also for local relevancy
Am I right in assuming that all I need to do is remove %2Fg% from the beginning of the code and add a /g/ to it, so it would be something like /g/2F1W5HFX_Z?
That’s the gist of it, Chris. The %2F you see in the URL is actually just the encoded forward slash. %2Fg%2F would translate to /g/.
Hi, Mike – I got here late and I see you’ve removed access to the bookmarklet – just wondered if it’s something you intend to bring back.
Hey Doc,
Sorry about that. WordPress’ editor has been stripping out my JS around that link and breaking it. I’ve updated it and the link will now send you to a standalone page that hosts the bookmarklet. You can navigate directly to it here: https://www.upbuild.io/tools/mreid/get.html
Thanks, Mike! Got it!
So what if you have a eCommerce store that sells, for example, “Books.” You want Google to view and display you in the SERPS related to “Books” rather than your Store Name. Would you incorporate this throughout your site?
What if someone else who doesn’t have as popular a store and wants to steal your traffic, integrates your machine ID throughout their site? Would Google then start to display their site when customers search for yours?
Nope. It doesn’t quite work like that, for the better. Like most of modern SEO, it’s not a matter of implementing the “One Weird Trick” and then having Google just do whatever you tell it to. Pointing to machine IDs, and entity association and semantic SEO in general, just provide additional clarity and context so that Google can make better decisions.
In your example, associating your site with the topic “books” could help, but probably won’t change anything. That a site discusses a broad topic is easy for Google to assess with or without machine IDs. But MREIDs can really shine when what you need is entity disambiguation — when Google is confused about what your site is or if you want to be associated with something that could just potentially be unclear to them. For example, if you had a business that sold designer barns to farmers called “Noble Barns”. You’d likely have a ton of entity confusion thanks to “Barnes & Noble”. You’d use an MREID link to gently redirect Google to the entity that your site is really about.
Seems like all my Google searches turn up no MREIDs in the knowledge graph, though the HTML says they’re there. Looks like the xpath changed on you already.
Couldn’t your script regex search for card_id:(%[^;]+) … ? The part inside the parens *should* be the MREID, if it exists on the page, right? (Or even /[mg]/[a-z0-9]+ — assuming there would only ever be one match.)
I tried to figure out how I could hack a bookmarklet to pop up a textbox with the /[mg]/[a-z0-9]+ pre-selected for copying, but, alas, that has so far proven beyond me. 🙁
ANyhow, thanks for your page. It sparked a lot of ideas a few months ago when I found it during MozCon, and I’m starting to implement more disambiguation in my employer’s website via Schema because of this. I hope it works!
Hi Rich,
Thanks for your comment. I tried to reproduce it and while I was unable to repro it consistently except while doing certain searches when logged in, you make a good point about the need for a more flexible identification method.
I couldn’t go the RegEx route while still keeping to vanilla JavaScript, but I ended up rewriting that portion of the bookmarklet to search for the card_id no matter where it appeared and parse things out from there.
Check out the page for the bookmarklet again and be sure to refresh. Let me know if you have any trouble with the new and improved version.
Thanks, Mike!
It worked for “Monty Python”! And then it worked for many other things, Microsoft, Apple, Albuquerque, Tyrannosaurus Rex, Berkeley, etc. Wahoo!
But then it failed on “Pennsylvania State University” and “Yale University” — weird. Though I note that both of those have links to “Claim this knowledge panel…”. Maybe a useful fallback?
Example: href=”https://posts.google.com/claim/?mid=/m/08815&refui=b”
Also, the included Check via Google Trends pulls in the “undefined” param, rather than the query. (https://trends.google.com/trends/explore?q=undefined )
BTW: Have you considered linking to:
– https://developers.google.com/apis-explorer/#p/kgsearch/v1/kgsearch.entities.search?query=Harvard+University
Thanks for your work!
Rich
Odly none of these work for me lol… any help with getting one for GreenWay Carpet Cleaning
located in Las Vegas NV?
Thanks
Hey Ben,
Sure thing. I found an MREID equal to /g/11g9g3df_x for Greenway Carpet Cleaning on this Google SERP https://www.google.com/search?q=greenway+carpet+cleaning+las+vegas
Are you able to get that as well? If you haven’t, I’d recommend removing the bookmarklet from your browser and grabbing the latest version from here: https://www.upbuild.io/tools/mreid/get.html
Good luck! I hope it works.
Hi Mike!
Have you been able to see improved SERPs using the MREID?
Best always!!
Joe
Hi Mike,
Would I add the mreid to my markup using the same url you produced above, but with my mreid? Meaning, i’d use this – “https://www.google.com/search?q=knowledge+graph+search+api&kponly&kgmid=”
Yep. That’s what I’d recommend! Just swap the example MREID out for yours.
Is it me? Am I misunderstanding something?
When I use the full “https://www.google.com/search?q=knowledge+graph+search+api&kponly&kgmid=:” regardless of the mreid, I get only the search results for the _knowledge graph search api_.
+ I can retrieve the mreid for any entity as you have described above in the code. So that part has remained consistent.
– Not finding via the feedback link (under KP anymore)
– Application of mreid in the JSON sameAs since knowledge graph search string not working?