score:1

Accepted answer
<script async src="https://www.googletagmanager_oops.com/gtag/js?id=UA-101203313-3"></script>

score:1

var scripts = Array.prototype.slice.call(document.getElementsByTagName('script'));

for (var i=0; i<scripts.length; i++) {
   var script = scripts[i];
   if (script.src && script.src.startsWith('https://www.googletagmanager.com') ){
      return getIdFromSrc(script.src);
   }
}

Related Query

More Query from same tag