Skip to content

Commit

Permalink
Add analytics for dbt.com in addition to getdbt (#430)
Browse files Browse the repository at this point in the history
* Add analytics for dbt.com in addition to getdbt

* Changie entry
  • Loading branch information
b-per authored Nov 28, 2023
1 parent 7a901c1 commit e9cbdad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Docs-20230615-105157.yaml
Original file line number Diff line number Diff line change
@@ -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"
11 changes: 9 additions & 2 deletions src/app/services/tracking_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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;
Expand Down

0 comments on commit e9cbdad

Please sign in to comment.