Skip to content

Commit dcc525b

Browse files
authored
Step 2 of #11620; don't load matomo for bots
1 parent 11caa2a commit dcc525b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

openlibrary/templates/site/head.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
<meta name="robots" content="noindex">
1717
<meta name="theme-color" content="#e2dcc5">
1818

19-
2019
<link rel="canonical" href="$request.canonical_url" />
21-
<link rel="preconnect" href="https://athena.archive.org">
22-
<link rel="preconnect" href="https://apollo.archive.org">
20+
21+
$if not is_bot():
22+
<link rel="preconnect" href="https://athena.archive.org">
23+
<link rel="preconnect" href="https://apollo.archive.org">
2324

2425
<link rel="search" type="application/opensearchdescription+xml" title="Open Library" href="/static/opensearch.xml">
2526
<link rel="manifest" href="/static/manifest.json">
@@ -59,12 +60,14 @@
5960
</style>
6061
</noscript>
6162
<script>
63+
$if not is_bot():
6264
var _mtm = window._mtm = window._mtm || [];
6365
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
6466
(function() {
6567
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
6668
g.async=true; g.src='https://apollo.archive.org/js/container_7cLc1b4U.js'; s.parentNode.insertBefore(g,s);
67-
})();
69+
})();
70+
6871
/* @licstart The following is the entire license notice for the
6972
* JavaScript code in this page served from openlibrary.org.
7073
*
@@ -84,16 +87,16 @@
8487
* @licend The above is the entire license notice
8588
* for the JavaScript code in this page.
8689
*/
87-
8890
</script>
91+
8992
$if "dev" in ctx.features:
9093
<link href="$static_url('build/css/page-dev.css')" rel="stylesheet" type="text/css"/>
9194

9295
<meta name="google-site-verification" content="KrqcZD4l5BLNVyjzSi2sjZBiwgmkJ1W7n6w7ThD7A74" />
9396
<meta name="google-site-verification" content="vtXGm8q3UgP-f6qXTvQBo85uh3nmIYIotVqqdJDpyz4" />
94-
<!-- Drini, Google Search Console -->
97+
<!-- Google Search Console -->
9598
<meta name="google-site-verification" content="XYOJ9Uj0MBr6wk7kj1IkttXrqY-bbRstFMADTfEt354" />
96-
<!-- Drini, Bing Webmaster Tools -->
99+
<!-- Bing Webmaster Tools -->
97100
<meta name="msvalidate.01" content="8BEBECBEF537077737975A49D55B857D" />
98101

99102
$putctx("sent_head", True)

0 commit comments

Comments
 (0)