Use FlurryAgent.onEvent(String eventId, Map parameters)

后端 未结 2 1132
伪装坚强ぢ
伪装坚强ぢ 2021-02-07 23:10

Please anybody tell how to use

FlurryAgent.onEvent(String eventId, Map parameters)

in an android activity to track events

2条回答
  •  情深已故
    2021-02-07 23:51

    I show you a simple example. In this code i want to log simple events and other events with a category.

    public void logAnalyticsEvent(final String versionName, final String strMsg, final String category){
    
            if (category==null){                
                FlurryAgent.logEvent(strMsg);           
    
            }else{              
                final HashMap parameters = new HashMap();
                parameters.put("Event",strMsg );
                FlurryAgent.logEvent(category, parameters);
            }
    
    
    }
    

    in the first part of the condition i'm logging the only the event, in the second part I put the name of the event inside de parameters (a hashmap with a key named "Event" and value the name of the event) and I log the name of the category with the parameters (events inside)

    FlurryAgent.logEvent(category, parameters);
    

    Hope this helps!

提交回复
热议问题