Skip to content

Commit

Permalink
chore: sort block trd order
Browse files Browse the repository at this point in the history
  • Loading branch information
robsongajunior committed Nov 5, 2024
1 parent 215bfe7 commit 695fe0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/components/html/trd3.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import GoogleTagManagerScript from '~/components/trd3/google-tag-manager/script.
import Taboola from '~/components/trd3/taboola/index.astro';
---

<GoogleTagManagerScript />
<Clarity />
<Hubspot />
<Taboola />
<GoogleTagManagerScript />
19 changes: 6 additions & 13 deletions src/components/trd3/google-tag-manager/script.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

<link rel="preconnect" href="https://www.googletagmanager.com/" />
<link rel="preconnect" href="https://www.google-analytics.com" />

<script async is:inline>
<script async type="text/javascript">
(function() {
window.dataLayer = window.dataLayer || [];

Expand Down Expand Up @@ -44,22 +45,13 @@
});
})();
</script>

<script is:inline async>
<script async type="text/javascript">
(function() {
if (window.location.origin !== 'https://www.azion.com' || window.location.search.match(/trd3=false/)) {
console.log('Google Analitycs: disabled');
console.log('Google GTAG: disabled');
return;
}

window.dataLayer = window.dataLayer || [];

function gtag(){
dataLayer.push(arguments);
}

gtag('js', new Date());

function load() {
let script = document.createElement('script');
script.async = true;
Expand All @@ -68,13 +60,14 @@
}

if(window.innerWidth >= 1024) {
setTimeout(function() {
setTimeout(function() {
load();
}, 2500)
} else {
setTimeout(function() {
load();
}, 5000)
}

})();
</script>

0 comments on commit 695fe0b

Please sign in to comment.