问题
Does anyone know if there is a way to set User Properties of Analytics for Firebase with Google Tag Manager? I'm not finding deep documentation about converging this two tools.
回答1:
Lets say you have a user property called exciting_sport and you have written the Firebase code for this user property as follows:
Analytics.setUserPropery("exciting_sport", xcitingsport);
Now in the GTM console you need to create a new variable that matches the user property key. Take a look at the attached screenshot.
The name of the user property key name should math exactly with the key set in the code. You can use this variable to create a Universal Analytics tag similar and add as a parameter in a event track type. This would work similar to any other event.
You can also add setUserID to the user property and track it likewise.
来源:https://stackoverflow.com/questions/46570633/analytics-for-firebase-user-properties-with-google-tag-manager