2

When I use the old Gmail I use this method:

https://mail.google.com/mail/u/0/#inbox/1630209116a3af45 and thread ID is: 1630209116a3af45.

In the new Gmail, the same thread link is: https://mail.google.com/mail/u/0/?zx=3xcdey2cogvc#inbox/FMfcgxmZVPbZvwJWCvBMvjxglSMPvsvW and there is no option to find it.

I also looked in the HTML source of the page and the thread ID is not there.

All of my searches show only the old Gmail behavior (like this: https://support.cloudhq.net/how-to-get-thread-id-of-a-gmail-thread/).

I want to find out how I can locate the thread id.

(I also tried to find it in the "show original" option, but I can find only the message id, and it does not help.)

2

You can get the thread id from the HTML. Try searching "data-legacy-thread-id" in the HTML elements.

Or you can find it by running JavaScript code in the console:

document.querySelector('[data-legacy-thread-id]').getAttribute('data-legacy-thread-id')
1

method 1:

  • press F12 while email is opened
  • go to Elements

method 2:

  • press F12 while email is opened
  • go to Console
  • paste: document.querySelector('[data-legacy-thread-id]').getAttribute('data-legacy-thread-id')
  • hit ENTER

  • Weird these answers were downvoted, especially without comments. It helped me realize I could search for the number in the DevTool Elements HTML view easy enough without needing to execute any JavaScript. The email I wanted was apparently on the first page in my Inbox, so that was easy enough. – Pysis Feb 5 at 15:58
1

I've found that the answers above do not work every time because the DOM, in some cases, might have more messages and thus many data-legacy-thread-id, as can be seen below: image showing multiple matches for DOM search

By tweaking the CSS selector a bit you get the correct data-legacy-thread-id:

document.querySelector('[role="main"] [data-legacy-thread-id]').getAttribute('data-legacy-thread-id')

To make my life easier I created a bookmarklet using:

javascript:(function(){prompt("Legacy Thread ID",document.querySelector('[role="main"] [data-legacy-thread-id]').getAttribute('data-legacy-thread-id'))}());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.