title: How should I track Fragments in Google Analytics v4?
body: <p>With the release of Google Analytics v4 (Android), what is the recommended way to track Fragment views? Is this solution still the recommended way - <a href="https://stackoverflow.com/a/19284014/413254">https://stackoverflow.com/a/19284014/413254</a>?</p>
  
  <p>The sample in the docs (<a href="https://developers.google.com/analytics/devguides/collection/android/v4/#analytics-xml" rel="nofollow noreferrer">https://developers.google.com/analytics/devguides/collection/android/v4/#analytics-xml</a>) has the following config:</p>
  
  <p><strong>global_tracker.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
      &lt;integer name="ga_sessionTimeout"&gt;300&lt;/integer&gt;
      &lt;bool name="ga_autoActivityTracking"&gt;true&lt;/bool&gt;
      &lt;screenName name="com.google.android.gms.analytics.samples.mobileplayground.ScreenviewFragment"&gt;
          AnalyticsSampleApp ScreenView
      &lt;/screenName&gt;
      &lt;screenName name="com.google.android.gms.analytics.samples.mobileplayground.EcommerceFragment"&gt;
          AnalyticsSampleApp EcommerceView
      &lt;/screenName&gt;
      &lt;!--  The following value should be replaced with correct property id. --&gt;
      &lt;string name="ga_trackingId"&gt;UA-XXXXXXX-Y&lt;/string&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>This configuration looks to be enabling auto tracking for Activities, but I'd assume this doesn't work any magic for Fragments? In this example, I'd assume the "AnalyticsSampleApp ScreenView" screen event will be sent if  <code>t.setScreenName(path);</code> is called and path is <code>"com.google.android.gms.analytics.samples.mobileplayground.EcommerceFragment"</code>?</p>