We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d5855f commit 0df4e0fCopy full SHA for 0df4e0f
codelab-elements/google-codelab-analytics/google_codelab_analytics.js
@@ -512,7 +512,7 @@ class CodelabAnalytics extends HTMLElement {
512
// First, set the GTAG data layer before pushing anything to it.
513
window[CODELAB_DATA_LAYER] = window[CODELAB_DATA_LAYER] || [];
514
515
- const firstScriptElement = document.getElementsByTagName('script')[0];
+ const firstScriptElement = document.querySelector('script');
516
const gtagScriptElement = /** @type {!HTMLScriptElement} */ (
517
document.createElement('script'));
518
gtagScriptElement.async = true;
0 commit comments