test(aio): cleaner approach to reliable Google Analytics e2e tests (#20661)
PR Close #20661
This commit is contained in:

committed by
Miško Hevery

parent
4ec4a99f16
commit
3def2cc552
@ -34,11 +34,13 @@
|
||||
|
||||
<!-- Google Analytics -->
|
||||
<script>
|
||||
// Note this is a customised version of the GA tracking snippet to aid e2e testing
|
||||
// See the bit between /**/.../**/
|
||||
// Note this is a customised version of the GA tracking snippet
|
||||
// See the comments below for more info
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;/**/i.sessionStorage.__e2e__||/**/m.parentNode.insertBefore(a,m)
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;
|
||||
~i.name.indexOf('NG_DEFER_BOOTSTRAP')|| // only load library if not running e2e tests
|
||||
m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
</script>
|
||||
<!-- End Google Analytics -->
|
||||
|
Reference in New Issue
Block a user