Skip to content

Commit

Permalink
fix: gtag script error (#838)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacksTsang committed May 16, 2023
1 parent 1a1f040 commit 9a2b0ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-analytics/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default (api: IApi) => {
gtagScript.async = true;
gtagScript.src = "https://www.googletagmanager.com/gtag/js?id=${code}";
var scr = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(gtagScript, scr);
scr.parentNode.insertBefore(gtagScript, scr);
window.dataLayer = window.dataLayer || [];
function gtag() {dataLayer.push(arguments);}
gtag('js', new Date());
Expand Down

0 comments on commit 9a2b0ec

Please sign in to comment.