Skip to content

Commit

Permalink
Switch GTM to defer
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdoc committed Mar 17, 2024
1 parent 968fd6d commit cf6c70c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

<link rel="alternate" type="application/rss+xml" title="{{ meta.title }} Blog" href="/blog/feed.xml" />

{% if data.env === "production" %}<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-K5WB4B6');</script>{% endif %}
{% if data.env === "production" %}<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.defer=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-K5WB4B6');</script>{% endif %}

</head>

Expand Down

0 comments on commit cf6c70c

Please sign in to comment.