title: How do I add an analytics label to data messages with the java Firebase Admin SDK?
body: <p>As of July 1, Firebase requires the addition of labels to messages in order for analytics to show about the number of data message sends etc.</p>
  
  <blockquote>
    <p>'Starting Monday, 1 July 2019, you will be able to filter data by an analytics label.
    Data messages sent without an analytics label might not be represented in this dashboard after that date.'</p>
  </blockquote>
  
  <p>The problem is that the link to the documentation provided by firebase <a href="https://firebase.google.com/docs/cloud-messaging/understand-delivery?authuser=0#adding_analytics_labels_to_messages" rel="noreferrer">here</a>, does not help. It only refers to HTTP requests whilst I am using the Firebase Admin SDK running on a Java app engine instance.</p>
  
  <p>This is the barebones of the code I am using to currently send data messages. How can I adapt this to send my messages with an analytics label?</p>
  
  <pre class="lang-java prettyprint-override"><code>Message message = Message.builder()
                  .putData("data",data)
                  .setToken(deviceID)
                  .build();
  
  
          String response = FirebaseMessaging.getInstance().send(message);
  </code></pre>