# June Cloud Mode Integration

<p>RudderStack lets you send your event data to June via <a href="https://www.rudderstack.com/docs/destinations/rudderstack-connection-modes/#cloud-mode" >cloud mode</a>.</p>
<p>Find the open-source transformer code for this destination in the <a href="https://github.com/rudderlabs/rudder-transformer/tree/main/src/v0/destinations/june">GitHub repository</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="identify">Identify</h2><p>You can use the <a href="https://www.rudderstack.com/docs/event-spec/standard-events/identify/" ><code>identify</code></a> call to create a new user or update an existing user&rsquo;s details in June. RudderStack sends the <code>identify</code> call to June using their <a href="https://www.june.so/docs/tracking/http-api/identify" ><code>identify</code></a> API.</p>

<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text">Make sure that you make an <code>identify</code> call before making a <code>track</code> or <code>group</code> call.</div>
  </div>
</blockquote>
<p>A sample <code>identify</code> call is shown below:</p>
<div class="rs-code">
  <div class="rs-code__head">javascript<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-javascript" data-lang="javascript">rudderanalytics.identify(&#34;1hKOmRA4el9Z&#34;, {
  name: &#34;Alex Keener&#34;,
  email: &#34;alex@example.com&#34;
})</code></pre></div>
</div>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="property-mapping"><strong>Property mapping</strong></h4><p>The following table lists the property mappings between RudderStack and June for the <code>identify</code> call:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Data type</th>
          <th>June property</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>userId</code><br /><code>traits.userId</code><br /><code>traits.id</code><br /><code>context.traits.userId</code><br /><code>context.traits.id</code> <br/> Required</td>
          <td>String</td>
          <td><code>userId</code></td>
      </tr>
      <tr>
          <td><code>originalTimestamp</code> <br /> <code>timestamp</code> <br/> Required</td>
          <td>Timestamp in ISO 8601 format <br />(<code>yyyy-MM-ddTHH:mm:ss.SSSZ</code>)</td>
          <td><code>timestamp</code></td>
      </tr>
      <tr>
          <td><code>anonymousId</code></td>
          <td>String</td>
          <td><code>anonymousId</code></td>
      </tr>
      <tr>
          <td><code>traits</code><br /> <code>context.traits</code></td>
          <td>Object</td>
          <td><code>traits</code></td>
      </tr>
      <tr>
          <td><code>context</code></td>
          <td>Object</td>
          <td><code>context</code></td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="track">Track</h2><p>The <a href="https://www.rudderstack.com/docs/event-spec/standard-events/track/" ><code>track</code></a> call lets you capture user events along with the properties associated with them. RudderStack sends the <code>track</code> call to June using their <a href="https://www.june.so/docs/tracking/http-api/track" ><code>track</code></a> API.</p>
<p>A sample <code>track</code> call is shown below:</p>
<div class="rs-code">
  <div class="rs-code__head">javascript<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-javascript" data-lang="javascript">// groupId using properties object
rudderanalytics.track(&#34;Product Reviewed&#34;, {
  review_id: &#34;12345&#34;,
  product_id: &#34;123&#34;,
  rating: 3.0,
  review_body: &#34;Average product, expected much more.&#34;,
  groupId: &#34;5H7ASAIEQO&#34;,
});

// groupId using context.externalId array
rudderanalytics.track(
  &#34;Product Reviewed&#34;, {
    review_id: &#34;12345&#34;,
    product_id: &#34;123&#34;,
    rating: 3.0,
    review_body: &#34;Average product, expected much more.&#34;,
  }, {
    externalId: [{
      type: &#34;juneGroupId&#34;,
      id: &#34;5H7ASAIEQO&#34;,
    }, ],
  }
);</code></pre></div>
</div>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="property-mapping-1"><strong>Property mapping</strong></h4><p>The following table lists the property mappings between RudderStack and June for the <code>track</code> call:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Data type</th>
          <th>June property</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>userId</code><br /><code>traits.userId</code><br /><code>traits.id</code><br /><code>context.traits.userId</code><br /><code>context.traits.id</code> <br/> Required</td>
          <td>String</td>
          <td><code>userId</code></td>
      </tr>
      <tr>
          <td><code>event</code>    <br/> Required</td>
          <td>String</td>
          <td><code>event</code></td>
      </tr>
      <tr>
          <td><code>originalTimestamp</code> <br /> <code>timestamp</code> <br/> Required</td>
          <td>Timestamp in ISO 8601 format <br />(<code>yyyy-MM-ddTHH:mm:ss.SSSZ</code>)</td>
          <td><code>timestamp</code></td>
      </tr>
      <tr>
          <td><code>anonymousId</code></td>
          <td>String</td>
          <td><code>anonymousId</code></td>
      </tr>
      <tr>
          <td><code>properties</code></td>
          <td>Object</td>
          <td><code>properties</code></td>
      </tr>
      <tr>
          <td><ul><li><code>context.externalId.id</code> (when <code>context.externalId.type</code> = <code>juneGroupId</code>)</li><li><code>properties.groupId</code></li></ul></td>
          <td>String</td>
          <td><code>context.groupId</code></td>
      </tr>
      <tr>
          <td><code>context</code></td>
          <td>Object</td>
          <td><code>context</code></td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="group">Group</h2><p>You can use the <a href="https://www.rudderstack.com/docs/event-spec/standard-events/group/" ><code>group</code></a> call to create a new company or update an existing company&rsquo;s details in June. Refer to the <a href="https://www.june.so/docs/tracking/http-api/group" >June documentation</a> for more information.</p>

<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text">If you are using a <code>group</code> call to identify a company, it is recommended to pass the <code>groupId</code> in the <code>track</code> call. It allows you to specify which company performed that specific event.</div>
  </div>
</blockquote>
<p>A sample <code>group</code> call is shown below:</p>
<div class="rs-code">
  <div class="rs-code__head">javascript<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-javascript" data-lang="javascript">rudderanalytics.group(&#34;23Np893Z6&#34;, {
  name: &#34;ABC company&#34;,
  employees: 100,
  Industry: &#34;Video game publisher&#34;,
  Founded: 1979
});</code></pre></div>
</div>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="property-mapping-2"><strong>Property mapping</strong></h4><p>The following table lists the property mappings between RudderStack and June for the <code>group</code> call:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Data type</th>
          <th>June property</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>userId</code><br /><code>traits.userId</code><br /><code>traits.id</code><br /><code>context.traits.userId</code><br /><code>context.traits.id</code> <br/> <ul><li>Required for creating a company.</li><li>Optional for updating the company details.</li></ul></td>
          <td>String</td>
          <td><code>userId</code></td>
      </tr>
      <tr>
          <td><code>originalTimestamp</code> <br /> <code>timestamp</code> <br/> Required</td>
          <td>Timestamp in ISO 8601 format <br />(<code>yyyy-MM-ddTHH:mm:ss.SSSZ</code>)</td>
          <td><code>timestamp</code></td>
      </tr>
      <tr>
          <td><code>groupId</code> <br /><code>traits.groupId</code>    <br/> Required</td>
          <td>String</td>
          <td><code>groupId</code></td>
      </tr>
      <tr>
          <td><code>anonymousId</code></td>
          <td>String</td>
          <td><code>anonymousId</code></td>
      </tr>
      <tr>
          <td><code>traits</code> <br /> <code>context.traits</code></td>
          <td>Object</td>
          <td><code>traits</code></td>
      </tr>
      <tr>
          <td><code>context</code></td>
          <td>Object</td>
          <td><code>context</code></td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="page">Page</h2><p>You can use the <a href="https://www.rudderstack.com/docs/event-spec/standard-events/page/" ><code>page</code></a> call to record and send page views to June.</p>
<p>A sample <code>page</code> event:</p>
<div class="rs-code">
  <div class="rs-code__head">javascript<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-javascript" data-lang="javascript">rudderanalytics.page(&#34;Home&#34;);</code></pre></div>
</div>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="property-mapping-3"><strong>Property mapping</strong></h4><table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Data type</th>
          <th>June property</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties</code> <br/> Required</td>
          <td>Object</td>
          <td><code>properties</code></td>
      </tr>
      <tr>
          <td><code>userId</code><br /><code>traits.userId</code><br /> <code>traits.id</code><br /> <code>context.traits.userId</code><br /> <code>context.traits.id</code></td>
          <td>String</td>
          <td><code>userId</code></td>
      </tr>
      <tr>
          <td><code>timestamp</code><br /><code>originalTimestamp</code></td>
          <td>Timestamp in ISO 8601 format <br />(<code>yyyy-MM-ddTHH:mm:ss.SSSZ</code>)</td>
          <td><code>timestamp</code></td>
      </tr>
      <tr>
          <td><code>anonymousId</code></td>
          <td>String</td>
          <td><code>anonymousId</code></td>
      </tr>
      <tr>
          <td><code>groupId</code></td>
          <td>String</td>
          <td><code>context.groupId</code></td>
      </tr>
      <tr>
          <td><code>context</code></td>
          <td>Object</td>
          <td><code>context</code></td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="faq">FAQ</h2><!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="can-i-make-an-identify-or-track-call-using-anonymousid">Can I make an <code>identify</code> or <code>track</code> call using <code>anonymousId</code>?</h4><p>No, you cannot. June does not stitch identities together or support merging anonymous users. It is best used to measure user activation and retention when the user is logged in.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="my-user-is-created-as-unknown-in-june-dashboard-what-might-be-the-reason">My user is created as <code>Unknown</code> in June dashboard. What might be the reason?</h4><p>June categorizes a user as <code>Unknown</code> if the <code>firstName</code>, <code>lastName</code>, <code>name</code>, <code>username</code>, or <code>email</code> is not present in the <code>traits</code> object of the <code>identify</code> call.</p>

