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;