Skip to content

Commit

Permalink
fix(console): push to dataleyer only when analytics is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
arielweinberger committed Nov 13, 2023
1 parent 75a5729 commit 691a7be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/console/src/lib/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export const useIdentify = (user: GetMeQuery["me"]) => {
const window = (global as any).window;

// GTM data layer
window.dataLayer.push({ ...identifyRequest });
if (window.dataLayer) {
window.dataLayer.push({ ...identifyRequest });
}
}, [user, organizationId, projectId]);
};

Expand Down

0 comments on commit 691a7be

Please sign in to comment.