Skip to content

Commit e36254c

Browse files
rthjorisvandenbossche
authored andcommitted
MNT: Anonimize IP for Google Analytics (scikit-learn#12038)
1 parent 06b4307 commit e36254c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

doc/themes/scikit-learn/layout.html

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -340,17 +340,13 @@ <h2>Machine Learning in Python</h2>
340340
</div>
341341

342342
{% if theme_google_analytics|tobool %}
343-
<script type="text/javascript">
344-
var _gaq = _gaq || [];
345-
_gaq.push(['_setAccount', 'UA-22606712-2']);
346-
_gaq.push(['_trackPageview']);
347-
348-
(function() {
349-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
350-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
351-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
352-
})();
343+
<script>
344+
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
345+
ga('create', 'UA-22606712-2', 'auto');
346+
ga('set', 'anonymizeIp', true);
347+
ga('send', 'pageview');
353348
</script>
349+
<script async src='https://www.google-analytics.com/analytics.js'></script>
354350
{% endif %}
355351
<script>
356352
(function() {

0 commit comments

Comments
 (0)