The th:block is synthetic element that allows union some content in one block. It is useful when you don't have appropriate container element or you don't want specify it.

    <script async 
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'UA-XXXXXXXX-1');

<table> <!-- don't want specify <tbody> --> <th:block th:each="user : ${users}"> <tr> <td th:text="${user.login}">...</td> <td th:text="${}">...</td> </tr> <tr> <td colspan="2" th:text="${user.address}">...</td> </tr> </th:block> </table>

Consider the first example in more detail. A Google Analytics code must be in <head> section of the page. The insert code has two <script> elements. If you want to have analytics only on production, you need add a condition attribute to these elements (two times). Or you can use th:block as a container and add a condition to it once.