From 667bcbf350bd27ba05acd575b7026923997f2de0 Mon Sep 17 00:00:00 2001 From: Vega Date: Mon, 25 Nov 2024 08:57:51 -0800 Subject: [PATCH 1/4] fix(celebrus): missing event --- docusaurus.config.js | 8 ++++++++ quickstarts/_partials/run-vantage.mdx | 4 ++-- static/js/gtm-events.js | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 static/js/gtm-events.js diff --git a/docusaurus.config.js b/docusaurus.config.js index 6325cb62f2..18acf8833c 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -75,6 +75,14 @@ const trackingScripts = [ gtag('config', '${gtTagId}'); `, }, + { + tagName: 'script', + attributes: { + type: 'text/javascript', + src: '/js/gtm-events.js', + async: 'true', + }, + }, ]; /** @type {import('@docusaurus/types').Config} */ diff --git a/quickstarts/_partials/run-vantage.mdx b/quickstarts/_partials/run-vantage.mdx index d39394ecf0..4f16c74879 100644 --- a/quickstarts/_partials/run-vantage.mdx +++ b/quickstarts/_partials/run-vantage.mdx @@ -39,11 +39,11 @@ PDE state is RUN/STARTED. DBS state is 5: Logons are enabled - The system is quiescent ``` -
+
See examples of messages that pdestate returns when the database is still initializing. -
+
 PDE state is DOWN/HARDSTOP.
 
 PDE state is START/NETCONFIG.
diff --git a/static/js/gtm-events.js b/static/js/gtm-events.js
new file mode 100644
index 0000000000..29ea73741e
--- /dev/null
+++ b/static/js/gtm-events.js
@@ -0,0 +1,20 @@
+// this script instruments elements to emit GTM events
+for (let e of document.getElementsByClassName("emits-gtm-events")) {
+    e.addEventListener("click", function () {
+      dataLayer.push({
+        event: e.id,
+      });
+    });
+  
+    const hljsElem = e.getElementsByClassName("hljs")[0];
+    if (hljsElem) {
+      hljsElem.addEventListener("copy", function () {
+        console.log("copy event");
+        dataLayer.push({
+          event: "copy_code",
+          element: e.id,
+        });
+      });
+    }
+  }
+  
\ No newline at end of file

From a21fa235182b4763fca2723feb59caab2bf8edff Mon Sep 17 00:00:00 2001
From: Vega 
Date: Tue, 26 Nov 2024 12:33:03 -0800
Subject: [PATCH 2/4] fix(celebrus): changed the gtm-event

---
 quickstarts/_partials/run-vantage.mdx | 11 ++++++++---
 static/js/gtm-events.js               | 28 +++++++++++++--------------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/quickstarts/_partials/run-vantage.mdx b/quickstarts/_partials/run-vantage.mdx
index 4f16c74879..7bffeddb64 100644
--- a/quickstarts/_partials/run-vantage.mdx
+++ b/quickstarts/_partials/run-vantage.mdx
@@ -28,22 +28,27 @@
 To paste into Gnome Terminal press SHIFT+CTRL+V.
 :::
 
+
```bash watch pdestate -a ``` +
You want to wait till you see the following message: +
```bash PDE state is RUN/STARTED. DBS state is 5: Logons are enabled - The system is quiescent ``` +
-
+
+
See examples of messages that pdestate returns when the database is still initializing. -
+
 PDE state is DOWN/HARDSTOP.
 
 PDE state is START/NETCONFIG.
@@ -66,7 +71,7 @@ PDE state is RUN/STARTED.
 
- +
- Now that the database is up, go back to the virtual desktop and launch `Teradata Studio Express` ![Start Teradata Studio Express](../images/run-vantage/start-teradata-studio-express.png) diff --git a/static/js/gtm-events.js b/static/js/gtm-events.js index 29ea73741e..f4c75f96a5 100644 --- a/static/js/gtm-events.js +++ b/static/js/gtm-events.js @@ -1,20 +1,18 @@ -// this script instruments elements to emit GTM events -for (let e of document.getElementsByClassName("emits-gtm-events")) { - e.addEventListener("click", function () { - dataLayer.push({ - event: e.id, + + document.addEventListener("click", function (event) { + const target = event.target; + + if (target.closest(".emits-gtm-events")) { + const id = target.closest(".emits-gtm-events").id; + window.dataLayer.push({ + event: id, }); - }); + } - const hljsElem = e.getElementsByClassName("hljs")[0]; - if (hljsElem) { - hljsElem.addEventListener("copy", function () { - console.log("copy event"); - dataLayer.push({ - event: "copy_code", - element: e.id, - }); + if (target.closest("cv-code-snippet")) { + window.dataLayer.push({ + event: "copy_code", }); } - } + }); \ No newline at end of file From 7857171c1d6e28ff7339c9aa979f296701414b3c Mon Sep 17 00:00:00 2001 From: Daniel Herrera Date: Tue, 17 Dec 2024 10:30:35 +0100 Subject: [PATCH 3/4] added region of google analytics --- src/config/baseHeadTags.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config/baseHeadTags.js b/src/config/baseHeadTags.js index 809d436eea..0b84e3cab1 100644 --- a/src/config/baseHeadTags.js +++ b/src/config/baseHeadTags.js @@ -13,6 +13,7 @@ const allowedUrls = [ 'https://td.doubleclick.net/', 'https://www.youtube.com/', 'https://*.algolia.net/', + 'https://region1.analytics.google.com' ]; const baseHeadTags = [ From 809dd5df68fe726d0c38639a8f651b115cd9d85c Mon Sep 17 00:00:00 2001 From: Daniel Herrera Date: Tue, 17 Dec 2024 11:03:20 +0100 Subject: [PATCH 4/4] added google to authorized domains --- src/config/baseHeadTags.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config/baseHeadTags.js b/src/config/baseHeadTags.js index 0b84e3cab1..601e426f68 100644 --- a/src/config/baseHeadTags.js +++ b/src/config/baseHeadTags.js @@ -13,7 +13,8 @@ const allowedUrls = [ 'https://td.doubleclick.net/', 'https://www.youtube.com/', 'https://*.algolia.net/', - 'https://region1.analytics.google.com' + 'https://region1.analytics.google.com', + 'https://stats.g.doubleclick.net' ]; const baseHeadTags = [