From e9cbdad31d53393b7b2d51af10699457575070b5 Mon Sep 17 00:00:00 2001 From: Benoit Perigaud <8754100+b-per@users.noreply.github.com> Date: Tue, 28 Nov 2023 21:17:57 +0100 Subject: [PATCH] Add analytics for dbt.com in addition to getdbt (#430) * Add analytics for dbt.com in addition to getdbt * Changie entry --- .changes/unreleased/Docs-20230615-105157.yaml | 6 ++++++ src/app/services/tracking_service.js | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .changes/unreleased/Docs-20230615-105157.yaml diff --git a/.changes/unreleased/Docs-20230615-105157.yaml b/.changes/unreleased/Docs-20230615-105157.yaml new file mode 100644 index 0000000000..327e33b2e0 --- /dev/null +++ b/.changes/unreleased/Docs-20230615-105157.yaml @@ -0,0 +1,6 @@ +kind: Docs +body: Add analytics for dbt.com +time: 2023-06-15T10:51:57.838991+02:00 +custom: + Author: b-per + Issue: "430" diff --git a/src/app/services/tracking_service.js b/src/app/services/tracking_service.js index 17bdec38ec..70bbe516ff 100644 --- a/src/app/services/tracking_service.js +++ b/src/app/services/tracking_service.js @@ -32,7 +32,9 @@ angular } service.isHosted = function() { - return window.location.hostname.indexOf('.getdbt.com') > -1; + hostedgetdbt = window.location.hostname.indexOf('.getdbt.com') > -1; + hosteddbt = window.location.hostname.indexOf('.dbt.com') > -1; + return hostedgetdbt || hosteddbt; } service.turn_on_tracking = function() { @@ -52,7 +54,12 @@ angular } if (service.isHosted()) { - trackerParams.cookieDomain = '.getdbt.com'; + if (window.location.hostname.indexOf('.getdbt.com') > -1) { + trackerParams.cookieDomain = '.getdbt.com'; + } + else { + trackerParams.cookieDomain = '.dbt.com'; + } } service.snowplow = window.snowplow;