More work on the initial loading.

This commit is contained in:
Scott Idem
2024-11-21 17:03:47 -05:00
parent d1f04e4dc3
commit 600bf7caa4
2 changed files with 21 additions and 23 deletions

View File

@@ -1,8 +1,10 @@
<script lang="ts">
// import { page } from '$app/stores'
export let log_lvl = 0;
export let site_google_tracking_id: string = '';
console.log(`site_google_tracking_id = `, site_google_tracking_id);
if (log_lvl) {
console.log(`AE Analytics: site_google_tracking_id = `, site_google_tracking_id);
}
if (typeof window !== 'undefined') {
window.dataLayer = window.dataLayer || [];
@@ -11,14 +13,10 @@ if (typeof window !== 'undefined') {
};
window.gtag('js', new Date());
window.gtag('config', site_google_tracking_id);
if (log_lvl) {
console.log(`AE Analytics: Google Analytics Tracking ID = `, site_google_tracking_id);
}
}
// $: if (typeof gtag !== 'undefined') {
// gtag('config', site_google_tracking_id, {
// page_title: document.title,
// page_path: $page.url.pathname,
// })
// }
</script>
<svelte:head>
@@ -26,14 +24,4 @@ if (typeof window !== 'undefined') {
async
src="https://www.googletagmanager.com/gtag/js?id={site_google_tracking_id}">
</script>
<!-- <script>
window.dataLayer = window.dataLayer || []
function gtag() {
dataLayer.push(arguments)
}
gtag('js', new Date())
gtag('config', site_google_tracking_id)
</script> -->
</svelte:head>