fix(analytics): record user ID in GA if consented

This commit is contained in:
Kalista Payne
2025-08-27 13:59:15 -05:00
parent 7644e202c9
commit 305192ed1f
2 changed files with 7 additions and 3 deletions

View File

@@ -106,8 +106,9 @@ export async function setup () {
const user = _getConsentedUser();
if (!user) return;
await Vue.loadScript(`https://www.googletagmanager.com/gtag/js?id=${GA_ID}`);
if (DEBUG_ENABLED || !IS_PRODUCTION) {
window.gtag('config', GA_ID, { debug_mode: true });
}
window.gtag('config', GA_ID, {
debug_mode: DEBUG_ENABLED || !IS_PRODUCTION,
user_id: user._id,
});
amplitude.getInstance().init(AMPLITUDE_KEY);
}