From 585c30e5b8cf4e6f375f5a4eee8c8c7b96bf1f1a Mon Sep 17 00:00:00 2001 From: Josh Radcliff Date: Mon, 26 Feb 2024 17:01:30 -0500 Subject: [PATCH] Add a debug panel and Login page --- src/public/layouts/layout.eta | 8 +++- src/public/login.eta | 83 ++++++++++++++++++++++++++++++++++ src/public/newsletter.eta | 2 +- src/public/partials/debug.eta | 75 ++++++++++++++++++++++++++++++ src/public/partials/footer.eta | 2 +- src/public/partials/nav.eta | 3 ++ 6 files changed, 170 insertions(+), 3 deletions(-) create mode 100644 src/public/login.eta create mode 100644 src/public/partials/debug.eta diff --git a/src/public/layouts/layout.eta b/src/public/layouts/layout.eta index ab5d0e6..952757c 100644 --- a/src/public/layouts/layout.eta +++ b/src/public/layouts/layout.eta @@ -24,6 +24,10 @@ } else { gtag('consent', 'default', JSON.parse(localStorage.getItem('consentMode'))); } + + if(localStorage.getItem('userId') != null) { + window.dataLayer.push({'user_id': localStorage.getItem('userId')}); + } - \ No newline at end of file + diff --git a/src/public/login.eta b/src/public/login.eta new file mode 100644 index 0000000..39833a7 --- /dev/null +++ b/src/public/login.eta @@ -0,0 +1,83 @@ +<% layout("layout", { title: "Login - GA Tutorials" }) %> + +<%~ includeFile("nav") %> + +
+

Simulate login to set User ID

+
+
+ + + This form simply + sets your User ID so tagging will include it in events. To log out, submit + the form without a value. +
+ + + +
+
+ + + +<%~ includeFile("footer.eta") %> + \ No newline at end of file diff --git a/src/public/newsletter.eta b/src/public/newsletter.eta index cea8ff9..8de1a82 100644 --- a/src/public/newsletter.eta +++ b/src/public/newsletter.eta @@ -6,7 +6,7 @@

Signup for our Newsletter

- + This form does not save your email. It is for the diff --git a/src/public/partials/debug.eta b/src/public/partials/debug.eta new file mode 100644 index 0000000..91ff977 --- /dev/null +++ b/src/public/partials/debug.eta @@ -0,0 +1,75 @@ +
+ + +
+ + +
+ + + + + + + + +
+
+ + diff --git a/src/public/partials/footer.eta b/src/public/partials/footer.eta index 0b58f19..0f0db21 100644 --- a/src/public/partials/footer.eta +++ b/src/public/partials/footer.eta @@ -23,7 +23,7 @@
Subscribe to our newsletter

This is a demo and does not save your email.

- +
diff --git a/src/public/partials/nav.eta b/src/public/partials/nav.eta index 6d56cdd..30cb114 100644 --- a/src/public/partials/nav.eta +++ b/src/public/partials/nav.eta @@ -15,6 +15,9 @@ +