我希望通过使用自定义属性将它们分开来跟踪我的应用程序的受众.每个用户都有一个权限列表.我希望能够在登录我的应用程序时将它们与此属性分开.
目前,所有用户都属于"Alls Users"类别,而不是他们各自的类别...... 我使用CEO登录超过10次,我等了几天......但是,我只看到了所有用户的受众名称而不是我定制的"CEO"观众.
以下是我设置属性的方法:
注意:在我的示例中,假设getRole()返回的用户角色是'CEO'
在我的LoginActivity.java中
for (EntityRole mRole : new ArrayList<>(profile.getRoles())) {
mRole.setUser(profile);
GenericDAO.getInstance(EntityRole.class).addOrUpdate(mRole);
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.SIGN_UP_METHOD, mRole.getRole());
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.LOGIN, bundle);
}
Run Code Online (Sandbox Code Playgroud)
这是我在Firebase中的设置:
结果如下:
Google已使用Firebase Analytics和Firebase远程配置为A/B测试发布了全新的API和服务.
虽然我尝试将该服务用于其他目的(此处和此处),但我还需要将其用于A/B测试.
事实是,我无法找到如何让它显示分析实验变体结果所需的信息.
它只是没有显示(在这个网站上),或者我没有看到正确的地方:
为了尝试一个实验,我按照教程说我应该做的,包括:
boolean isDebug = AppComponentsHelper.isInDebugFlavour(context);
mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder().setDeveloperModeEnabled(isDebug).build();
mFirebaseRemoteConfig.setConfigSettings(configSettings);
final HashMap<String, Object> defaults = new HashMap<>();
for (ExperimentType experimentType : ExperimentType.values())
defaults.put(experimentType.experimentId, experimentType.defaultValues);
mFirebaseRemoteConfig.setDefaults(defaults);
long cacheExpiration = isDebug ? 0 : TimeUnit.HOURS.toSeconds(1);
mFirebaseRemoteConfig.fetch(cacheExpiration)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
mFirebaseRemoteConfig.activateFetched();
final FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(context); …Run Code Online (Sandbox Code Playgroud)firebase控制台上的帮助部分说明了这一点
Firebase应用最多可以拥有25个唯一命名的用户属性(区分大小写).您应该使用非变量属性的属性,例如"handedness = right","spender = true".
在firebase文档中,一个属性就是这样设置的
mFirebaseAnalytics.setUserProperty("favorite_food", mFavoriteFood);
Run Code Online (Sandbox Code Playgroud)
这是否意味着对于名为k并且具有值v的每个用户属性,我们需要在控制台中创建一个用户属性" k = v "并通过setUserProperty(k,v)在代码中设置它?因此,对于名为"favorite_food"的用户属性,可能的值为"pasta"和"pizza",需要在控制台中创建两个新的用户属性"favorite_food = pasta"和"favorite_food = pizza"并设置为比方说,setUserProperty("favorite_food","pasta")?
我正在尝试将Firebase RemoteConfig和Google Analytics与我的Android应用程序集成.远程配置部分正在运行但分析部分无法正常工作.这是我的build.gradle
// Firebase configuration
compile group:'com.google.firebase', name:'firebase-core', version: '9.4.0'
compile group:'com.google.firebase', name:'firebase-config', version: '9.4.0'
// Firebase analytics
compile 'com.google.android.gms:play-services-analytics:9.4.0'
Run Code Online (Sandbox Code Playgroud)
这是我的活动代码.
FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(this);
firebaseAnalytics.setUserId("5107611364");
firebaseAnalytics.setUserProperty("custom_user_property", "custom_user_proerty_value");
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "SomeID");
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "SomeIDName");
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "IdType");
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
Run Code Online (Sandbox Code Playgroud)
我正在尝试发布客户资产以及事件,但他们都没有工作.我启用了adb日志记录,我可以看到自定义事件和属性已发布.即使在24小时后,这些也不会出现在Firebase Analytics控制台上.我不知道出了什么问题.
我正在尝试对存储在Google BigQuery中的Firebase事件执行一个非常简单的查询,但我无法找到方法来执行此操作.
在Android应用中,我记录了这样的事件:
Bundle params = new Bundle();
params.putInt("productID", productId);
params.putInt(FirebaseAnalytics.Param.VALUE, value);
firebaseAnalytics.logEvent("productEvent", params);
Run Code Online (Sandbox Code Playgroud)
所以,在BigQuery中我有这样的东西:
___________________ _______________________ ____________________________ | event_dim.name | event_dim.params.key | event_dim.params.int_value | |___________________|_______________________|____________________________| | productEvent | productID | 25 | | |_______________________|____________________________| | | value | 1253 | |___________________|_______________________|____________________________|
当我从这个表中获取数据时,我得到两行:
___________________ _______________________ ____________________________ |event_dim.name | event_dim.params.key | event_dim.params.int_value | |___________________|_______________________|____________________________| | productEvent | productID | 25 | | productEvent | value | 12353 |
但我真正需要的是此表中的SELECT子句来获取如下数据:
___________________ _____________ _________ | name | productID | value | |___________________|_____________|_________| | …
我加入火力地堡分析使用coocapods,我Podfile被
platform :ios, '8.0'
use_frameworks!
workspace 'ProjectWorkspace.xcworkspace'
abstract_target 'Shows' do
pod 'SwiftProtobuf', git: 'https://github.com/apple/swift-protobuf.git', :tag => '0.9.24'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
target 'HostApp' do
project 'HostAppFolder/HostApp.xcodeproj'
end
target 'HostAppReleaseTarget' do
project 'HostAppFolderApp/HostApp.xcodeproj'
end
target 'FrameWorkProject' do
project 'FrameworkProjectFolder/FrameWorkProject.xcodeproj'
end
end
Run Code Online (Sandbox Code Playgroud)
如果我添加SwiftProtobuf只依赖它的正常工作的主机应用程序以及为框架的项目。
如果我想补充火力地堡的依赖,我得到一个运行时错误和应用程序错误味精崩溃
Foo类在HostApplicationPath和FrameworkProjectPath中都实现。将使用两者之一。哪一个未定义。
对于Firebase的每个类文件。
当我从框架项目,它的做工精细删除其他连接标志$(继承),但我不能火力使用到我的框架项目。
我的框架和主机应用程序是用Swfit 3.0编写的,xcode版本是8.x
我的项目结构是我手动创建一个工作区,并把它命名为“EVAWorkspace.xcworkspace”,并增加我的主机应用程序和框架项目到这个工作区,然后我加入的CocoaPods到工作区。
Eva是框架项目,而EvaApp是宿主应用程序项目。
我试图查看我的应用程序的哪些部分最常用,为此,我添加了一个logEvent类似的代码:
Bundle bundle= new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, "action");
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "screen_a");
FirebaseAnalytics.getInstance(context).logEvent(FirebaseAnalytics.Event,VIEW_ITEM, bundle);
Run Code Online (Sandbox Code Playgroud)
事件被记录下来,我可以在“事件”部分的“仪表板”中看到view_item带有Count 的条目,但是,当我输入它时,我可以看到计数,即值,但是看不到“ screen_a”或“ screen_b“ ...
由于这些不是自定义事件,因此这些值在仪表板中不可用吗?
今天我从Firebase Analytics收到了一个奇怪的警告.它是:
<Warning> [Firebase/Analytics][I-ACS031011] Root view controller not found
Run Code Online (Sandbox Code Playgroud)
我使用的方法基本上是删除帖子,然后向用户显示状态栏通知,删除帖子.这是我们想要删除帖子时调用的方法.
HomeViewNetwork.deletePost(postBlock: self.postDataBlock, handler: {
AlertManager.showStatusRed(title: "Post deleted!")
})
Run Code Online (Sandbox Code Playgroud)
我的显示状态功能是:
class func showStatusRed(title: String) {
let statusMessage = MessageView.viewFromNib(layout: .StatusLine)
var config = SwiftMessages.defaultConfig
config.presentationContext = .window(windowLevel: UIWindowLevelStatusBar)
statusMessage.configureContent(body: title)
statusMessage.backgroundView.backgroundColor = UIColor(red:0.98, green:0.11, blue:0.35, alpha:1.00)
setUpStatusView(messageView: statusMessage)
statusSwiftMessages.show(config: config, view: statusMessage)
}
Run Code Online (Sandbox Code Playgroud)
如果我评论AlertManager.showStatusRed方法,则警告消失.我也使用SwiftMessages作为我的库来显示状态栏通知.
我不确定为什么当Xcode没有提供有关根视图控制器的任何问题时,Firebase会给我这个警告.任何帮助表示赞赏.
使用FirebaseCore 4.0.4(podfile.lock)符合Xcode 9 GM的Objective-C项目的相关问题:Xcode 9 <警告> [Firebase/Analytics] [I-ACS031011]未找到根视图控制器
我一直试图将我的ReactNative App连接到Firebase有两个原因-1.推送通知(成功完成)2.每个用户的事件日志记录。
我遇到了debugView的问题,无法在开发模式下获取实时事件,streamView但可以看到我的事件,但会稍等片刻。
对于以上-对于android-adb shell setprop debug.firebase.analytics.app“ package_name”
对于ios,我已将其添加-FIRAnalyticsDebugEnabled到我的xcode方案中。
但是这些似乎都没有用。
我有RN0.44。
谢谢,
firebase react-native firebase-authentication firebase-analytics
我正在尝试与react-navigation一起跟踪react-native-firebase上的屏幕名称。
这是我的代码。
const tracker = firebase.analytics()
function getCurrentRouteName(navigationState) {
if (!navigationState) {
return null;
}
const route = navigationState.routes[navigationState.index];
// dive into nested navigators
if (route.routes) {
return getCurrentRouteName(route);
}
return route.routeName;
}
export default class AppNavigation extends Component {
render() {
StatusBar.setBarStyle('light-content');
return (
<MainScreenNavigator
onNavigationStateChange={(prevState, currentState) => {
const currentScreen = getCurrentRouteName(currentState);
const prevScreen = getCurrentRouteName(prevState);
if (prevScreen !== currentScreen) {
// the line below uses the Google Analytics tracker
// change the tracker here to use other …Run Code Online (Sandbox Code Playgroud)react-native firebase-analytics react-native-navigation react-native-firebase
firebase ×9
android ×5
react-native ×2
swift ×2
ab-testing ×1
cocoapods ×1
ios ×1
objective-c ×1