title: Android : Tracking service component using google-analyticsV3
body: <p>I made an application showing a window while calling in certain case, using service component.</p>
  
  <p>The window contains info of callee.</p>
  
  <p>I wanna know how to track this window. </p>
  
  <p>Few buttons would be added with functions - ex : sending sms.</p>
  
  <p>And I just wanna count how many times this window has been shown.</p>
  
  <p>I found this question - <a href="https://stackoverflow.com/questions/10465793/android-can-i-use-google-analytics-inside-a-service">Android: can I use Google Analytics inside a Service?</a></p>
  
  <p>But it seems it's about old version of GA. </p>
  
  <p>And I failed to make that in my app.</p>
  
  <p>(I tried :</p>
  
  <pre><code>public class view extends Service {
  ...
  
  GoogleAnalytics mGA;
  Tracker gat;
  ...
  
  @Override
  public void onCreate() {
      super.onCreate();
      mGA = GoogleAnalytics.getInstance(app);
      gat = mGA.getTracker("UA-my-account");
      Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;(); 
      params.put("event", "test");
      gat.send(params); )
  </code></pre>
  
  <p>Let me know how to make tracker work in my app with GA V3.</p>
  
  <p>Thanks for any help.</p>