Search code examples
androidandroid-activitygoogle-analyticsgoogle-analytics-apigoogle-analytics-firebase

What is the purpose of having two different HitBuilders ( Social and Event)?


I am using google analytics for my application. I am using HitBuilder() to get the event hits and SocialBuilder() for social button hits.

Method For Social Button Hits

 public void sendGoogleAnalyticsSocialInteractionWithTarget(String SocialNetworkName,String SocialAction,String SocialTarget)
        {       
            dataTracker.send( new HitBuilders.SocialBuilder()                
                                            .setNetwork(SocialNetworkName) 
                                            .setAction(SocialAction)       
                                            .setTarget(SocialTarget)      
                                            .build());
        }

Method For Events Hit

  public void sendGoogleAnalyticsHitEvents(String category,String action,String label)
        {       
            dataTracker.send(new HitBuilders.EventBuilder()         
                                            .setCategory(category) 
                                            .setAction(action)   
                                            .setLabel(label)     
                                            .build());
        }

Except getting the hits details and count in different category,is there any other purpose for different HitBuilders?


Solution

  • Its the way the data model is created for Google Analytics.

    Events, Transactions, Pageviews, Social, AdWords are different data tables, with some related keys between them. In practice, this means that there are some of the more obscure dimensions/metric combinations that won't work.