mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix(analytics): record user ID in GA if consented
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user