From b7f1610859525d241c1a09e6bc321907de078f9a Mon Sep 17 00:00:00 2001 From: SamirLiu Date: Thu, 8 May 2025 14:03:08 +0800 Subject: [PATCH] update: DataLayer parameter --- layout/includes/head/analytics.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/includes/head/analytics.pug b/layout/includes/head/analytics.pug index 3d07d61..6357b7a 100644 --- a/layout/includes/head/analytics.pug +++ b/layout/includes/head/analytics.pug @@ -41,5 +41,5 @@ if (theme.google_tag_manager && theme.google_tag_manager.tag_id) "!{theme.google_tag_manager.domain ? theme.google_tag_manager.domain : 'https://www.googletagmanager.com'}/gtm.js?id="+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','!{theme.google_tag_manager.tag_id}'); btf.addGlobalFn('pjaxComplete', () => { - dataLayer.push({'event': 'pjaxComplete', 'page_path': window.location.pathname, 'page_title': document.title}); + dataLayer.push({'event': 'pjaxComplete', 'page_title': document.title, 'page_location': location.href, 'page_path': window.location.pathname}); }, 'google_tag_manager'); \ No newline at end of file