Skip to content

Commit 5744863

Browse files
author
Mike Taylor
authored
Merge pull request #1467 from nj4710/issue/1449
Fixes #1449 Changed GA to alternative async tracking snippet
2 parents 2a7d759 + 65f2d80 commit 5744863

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

webcompat/static/js/vendor/ga.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
2+
ga('create', 'UA-49507820-1', 'webcompat.com');
3+
ga('send', 'pageview');

webcompat/templates/layout.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,10 @@
3939
{% include "shared/footer.html" %}
4040
</div>
4141
{%- if config.PRODUCTION or config.STAGING -%}
42-
<script>
43-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
44-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
45-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
46-
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
47-
ga('create', 'UA-49507820-1', 'webcompat.com');
48-
ga('send', 'pageview');
49-
</script>
42+
<!-- Google Analytics -->
43+
<script src="{{ url_for('static', filename='js/vendor/ga.js') }}"></script>
44+
<script async src='https://www.google-analytics.com/analytics.js'></script>
45+
<!-- End Google Analytics -->
5046
<script src="{{ url_for('static', filename='js/webcompat.min.js')|bust_cache }}"></script>
5147
{% else %}
5248
<script src="{{ url_for('static', filename='js/vendor/jquery-1.11.2.min.js') }}"></script>

0 commit comments

Comments
 (0)