# Drip Cloud Mode Integration


<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">For more information on sending events via cloud mode, refer to the <a href="https://www.rudderstack.com/docs/destinations/rudderstack-connection-modes/" >RudderStack Connection Modes</a> guide.</div>
  </div>
</blockquote>

</html>
<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/drip">GitHub repository</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="identify">Identify</h2><p>The <code>identify</code> call lets you add a new user or update an existing user with the latest information like the user&rsquo;s <code>dripId</code>,<code>email</code>,<code>name</code>, etc.</p>
<p>If you provide the <strong>Campaign ID</strong> in the dashboard while setting up the destination, RudderStack will subscribe every user to this <code>campaign ID</code> by default. Alternatively, you can also send the information via the <code>identify</code> call using <code>externalId</code> as shown in the code snippet below. Note that this takes a higher precedence than the campaign ID provided in the RudderStack dashboard.</p>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">Either the <code>dripId</code> or <code>email</code> is required for the <code>identify</code> call. If you are creating a user, then you must provide the <code>email</code>. In case of updating a user, you can provide either the assigned <code>dripId</code> or <code>email</code>.</div>
  </div>
</blockquote>

</html>
<p>A sample <code>identify</code> call is as 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;user123&#34;,
  {
    email: &#34;sampleuser@testmail.com&#34;,
    firstName: &#34;Demo&#34;,
    lastName: &#34;Example&#34;,
    tags: [&#34;tag1&#34;, &#34;tag2&#34;],
    customFields: {
      filter1: &#34;filterval1&#34;,
    },
  },
  {
    externalId: [
      {
        type: &#34;dripCampaignId&#34;,
        id: &#34;&lt;your campaign id&gt;&#34;,
      },
      {
        type: &#34;dripId&#34;,
        id: &#34;&lt;user&#39;s drip id&gt;&#34;,
      },
    ],
  }
)</code></pre></div>
</div>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="identify-mapping">Identify Mapping</h3><p>The following table includes all fields in <code>identify</code> call with their relative mapping to the Drip fields:</p>
<table>
  <thead>
      <tr>
          <th><strong>RudderStack Field</strong></th>
          <th><strong>Drip Field</strong></th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>newEmail</code></td>
          <td><code>new_email</code></td>
      </tr>
      <tr>
          <td><code>phone</code></td>
          <td><code>phone</code></td>
      </tr>
      <tr>
          <td><code>firstName</code>/<code>first_name</code>/<code>firstname</code></td>
          <td><code>first_name</code></td>
      </tr>
      <tr>
          <td><code>lastName</code>/<code>last_name</code>/<code>lastname</code></td>
          <td><code>last_name</code></td>
      </tr>
      <tr>
          <td><code>tags</code></td>
          <td><code>tags</code></td>
      </tr>
      <tr>
          <td><code>removeTags</code></td>
          <td><code>remove_tags</code></td>
      </tr>
      <tr>
          <td><code>status</code></td>
          <td><code>status</code></td>
      </tr>
      <tr>
          <td><code>initialStatus</code></td>
          <td><code>initial_status</code></td>
      </tr>
      <tr>
          <td><code>timeZone</code></td>
          <td><code>time_zone</code></td>
      </tr>
      <tr>
          <td><code>country</code></td>
          <td><code>country</code></td>
      </tr>
      <tr>
          <td><code>city</code></td>
          <td><code>city</code></td>
      </tr>
      <tr>
          <td><code>zip</code></td>
          <td><code>zip</code></td>
      </tr>
      <tr>
          <td><code>euConsent</code></td>
          <td><code>eu_consent</code></td>
      </tr>
      <tr>
          <td><code>euConsentMessage</code></td>
          <td><code>eu_consent_message</code></td>
      </tr>
      <tr>
          <td><code>ip</code></td>
          <td><code>ip_address</code></td>
      </tr>
      <tr>
          <td><code>address</code></td>
          <td><code>address1</code></td>
      </tr>
      <tr>
          <td><code>address2</code></td>
          <td><code>address2</code></td>
      </tr>
      <tr>
          <td><code>lifetimeValue</code></td>
          <td><code>lifetime_value</code></td>
      </tr>
      <tr>
          <td><code>prospect</code></td>
          <td><code>prospect</code></td>
      </tr>
      <tr>
          <td><code>baseLeadScore</code></td>
          <td><code>base_lead_score</code></td>
      </tr>
      <tr>
          <td><code>customFields</code></td>
          <td><code>custom_fields</code></td>
      </tr>
  </tbody>
</table>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text"><p>Note that:</p>
<ul>
<li>If <code>customFields</code> is not present, RudderStack extracts all fields apart from the ones mentioned in the table above and constructs a <code>customFields</code> object.</li>
<li>If <code>customFields</code> is present and there are other fields apart from the ones mentioned in the table, RudderStack ignores them.</li>
<li>The <code>customFields</code> object’s value must not exceed 1000 characters and must contain only letters, numbers, and underscores. Otherwise, RudderStack drops its value.</li>
<li>The <code>address</code> field should be an object.</li>
</ul></div>
  </div>
</blockquote>

</html>
<p>When you provide the <strong>Campaign ID</strong>, you can also send some extra fields with the call.</p>
<p>The following table lists all supported fields for the <code>campaign</code> call:</p>
<table>
  <thead>
      <tr>
          <th><strong>RudderStack Field</strong></th>
          <th><strong>Drip Field</strong></th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>doubleOptin</code></td>
          <td><code>double_optin</code></td>
      </tr>
      <tr>
          <td><code>startingEmailIndex</code></td>
          <td><code>starting_email_index</code></td>
      </tr>
      <tr>
          <td><code>reactivateIfRemoved</code></td>
          <td><code>reactivate_if_removed</code></td>
      </tr>
  </tbody>
</table>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">For more information on using these fields, refer to the <a href="https://developer.drip.com/#subscribe-someone-to-an-email-series-campaign">Drip documentation</a>.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="track">Track</h2><p>The <code>track</code> call lets you record the user events and the information associated with them, like <code>action</code>, <code>occurred_at</code>, and <code>customFields</code>. Either <code>id</code> or <code>email</code> must be provided in this call.</p>
<p>The <strong>User Creation Mode</strong> option in the RudderStack dashboard lets you create a user with their <code>email</code> if they don&rsquo;t already exist. If you don&rsquo;t want new users to be created, disable this option.</p>

<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text">If the <code>dripId</code> is provided in the call, then new users will not be created even if the <strong>User Creation Mode</strong> option is enabled in the RudderStack dashboard.</div>
  </div>
</blockquote>
<p>A sample <code>track</code> call is as 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.track(
  &#34;Event Name&#34;,
  {
    email: &#34;sampleuser@testmail.com&#34;,
    affiliation: &#34;custom_store&#34;,
    order_id: &#34;123456&#34;,
    products: [
      {
        name: &#34;product_name&#34;,
        price: 10.0,
      },
    ],
  },
  {
    externalId: [
      {
        type: &#34;dripId&#34;,
        id: &#34;&lt;user&#39;s drip id&gt;&#34;,
      },
    ],
  }
)</code></pre></div>
</div>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="special-events">Special Events</h3>
<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text">This destination does not strictly adhere to the <a href="https://www.rudderstack.com/docs/event-spec/ecommerce-events-spec/" >RudderStack Ecommerce Event Spec</a>.</div>
  </div>
</blockquote>
<p>You can create or update a user order if the event name belongs to either of the following special events:</p>
<ul>
<li><code>order updated</code></li>
<li><code>order completed</code></li>
<li><code>order refunded</code></li>
<li><code>order cancelled</code></li>
<li><code>checkout started</code></li>
<li><code>fulfilled</code> / <code>order fulfilled</code></li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="track-fields">Track Fields</h3><p>A <code>track</code> call can contain the following fields:</p>
<table>
  <thead>
      <tr>
          <th><strong>RudderStack Field</strong></th>
          <th><strong>Drip Field</strong></th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>prospect</code></td>
          <td><code>prospect</code></td>
      </tr>
      <tr>
          <td><code>customFields</code></td>
          <td><code>properties</code></td>
      </tr>
      <tr>
          <td><code>occurred_at</code></td>
          <td><code>occurred_at</code></td>
      </tr>
  </tbody>
</table>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text"><p>Note that:</p>
<ul>
<li>If <code>customFields</code> is not present, RudderStack extracts all fields apart from the ones mentioned in the table above and constructs a <code>customFields</code> object.</li>
<li>If <code>customFields</code> is present and there are other fields apart from the ones mentioned in the table, RudderStack ignores them.</li>
<li>The <code>customFields</code> object’s value must not exceed 1000 characters and must contain only letters, numbers, and underscores. Otherwise, RudderStack drops its value.</li>
</ul></div>
  </div>
</blockquote>

</html>
<p>For the special events mentioned above, the following fields are also supported:</p>
<table>
  <thead>
      <tr>
          <th><strong>RudderStack Field</strong></th>
          <th><strong>Drip Field</strong></th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>affiliation</code></td>
          <td><code>provider</code></td>
      </tr>
      <tr>
          <td><code>initial_status</code></td>
          <td><code>initial_status</code></td>
      </tr>
      <tr>
          <td><code>order_id</code></td>
          <td><code>order_id</code></td>
      </tr>
      <tr>
          <td><code>order_public_id</code></td>
          <td><code>order_public_id</code></td>
      </tr>
      <tr>
          <td><code>total</code></td>
          <td><code>grand_total</code></td>
      </tr>
      <tr>
          <td><code>discount</code></td>
          <td><code>discounts</code></td>
      </tr>
      <tr>
          <td><code>tax</code></td>
          <td><code>total_taxes</code></td>
      </tr>
      <tr>
          <td><code>total_fees</code></td>
          <td><code>total_fees</code></td>
      </tr>
      <tr>
          <td><code>shipping</code></td>
          <td><code>total_shipping</code></td>
      </tr>
      <tr>
          <td><code>refund_amount</code></td>
          <td><code>refund_amount</code></td>
      </tr>
      <tr>
          <td><code>currency</code></td>
          <td><code>currency</code></td>
      </tr>
      <tr>
          <td><code>order_url</code></td>
          <td><code>order_url</code></td>
      </tr>
      <tr>
          <td><code>billing_address</code></td>
          <td><code>billing_address</code></td>
      </tr>
      <tr>
          <td><code>shipping_address</code></td>
          <td><code>shipping_address</code></td>
      </tr>
      <tr>
          <td><code>occurred_at</code></td>
          <td><code>occurred_at</code></td>
      </tr>
      <tr>
          <td><strong><code>products</code></strong></td>
          <td><code>items</code></td>
      </tr>
  </tbody>
</table>
<p>Note that <strong><code>products</code></strong> is an array of objects. Every object in this array can contain the following fields:</p>
<table>
  <thead>
      <tr>
          <th><strong>RudderStack Field</strong></th>
          <th><strong>Drip Field</strong></th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>product_id</code></td>
          <td><code>product_id</code></td>
      </tr>
      <tr>
          <td><code>sku</code></td>
          <td><code>sku</code></td>
      </tr>
      <tr>
          <td><code>name</code></td>
          <td><code>name</code></td>
      </tr>
      <tr>
          <td><code>product_variant_id</code></td>
          <td><code>product_variant_id</code></td>
      </tr>
      <tr>
          <td><code>brand</code></td>
          <td><code>brand</code></td>
      </tr>
      <tr>
          <td><code>price</code></td>
          <td><code>price</code></td>
      </tr>
      <tr>
          <td><code>quantity</code></td>
          <td><code>quantity</code></td>
      </tr>
      <tr>
          <td><code>categories</code></td>
          <td><code>categories</code></td>
      </tr>
      <tr>
          <td><code>discounts</code></td>
          <td><code>discounts</code></td>
      </tr>
      <tr>
          <td><code>taxes</code></td>
          <td><code>taxes</code></td>
      </tr>
      <tr>
          <td><code>fees</code></td>
          <td><code>fees</code></td>
      </tr>
      <tr>
          <td><code>shipping</code></td>
          <td><code>shipping</code></td>
      </tr>
      <tr>
          <td><code>total</code></td>
          <td><code>total</code></td>
      </tr>
      <tr>
          <td><code>url</code></td>
          <td><code>product_url</code></td>
      </tr>
      <tr>
          <td><code>image_url</code></td>
          <td><code>image_url</code></td>
      </tr>
  </tbody>
</table>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text"><p>The <code>products</code> field is not mandatory. However, if provided, each object must contain the <code>name</code> and <code>price</code> field, otherwise it will be dropped.</p>
<p><strong>Note that the <code>track</code> call will still not be aborted in such a scenario.</strong></p>
</div>
  </div>
</blockquote>

</html>

