# Custom Consent Management

<p>This guide walks you through the steps to integrate a custom consent management provider (other than OneTrust, Ketch, and iubenda) with RudderStack.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="prerequisites">Prerequisites</h2><p>Configure the consent information in your consent manager’s platform and note their unique IDs. Note that these consent category IDs are case-sensitive.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="configure-consent-settings">Configure consent settings</h2><p>While setting up a destination in the RudderStack dashboard, use the <strong>Consent settings</strong> section to configure the consent management provider settings for <strong>each source</strong> that you connect to a destination.</p>

<figure class="image--main "  >
    <a 
         href="/docs/images/data-governance/consent-mgmt.gif"
        
        >
        <img src="/docs/images/data-governance/consent-mgmt.gif" 
         
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<ol>
<li>Choose <strong>Custom</strong> provider from the dropdown.</li>
<li>Enter enter the consent category IDs relevant for the destination in the <strong>Enter consent category IDs</strong> field. You can specify multiple consent purpose IDs by pressing the <strong>Enter</strong> key after each ID.</li>
</ol>
<p>Note that the settings for specifying multiple consent IDs vary slightly for some destinations. Click <strong>Add more</strong> after specifying each consent category ID.</p>

<figure class="image--main "  >
    <a 
         href="/docs/images/data-governance/consent-management/custom-multiple-consent.webp"
        
        >
        <img src="/docs/images/data-governance/consent-management/custom-multiple-consent.webp" 
         
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text"><p>You can configure only one consent settings block per provider for each source type.</p>
<p>If you try to add a duplicate provider block for the same source type, RudderStack rejects the save or update request in the dashboard and API. This validation is enforced at write time.</p>
</div>
  </div>
</blockquote>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="specify-consent-logic">Specify consent logic</h3><p>For <strong>Custom</strong> consent management provider, you must also select the consent logic to be applied on the category IDs while resolving them against user consent data:</p>
<ul>
<li><strong>AND</strong>: Allows the events to go through to the destination <strong>only if</strong> the end user consents to all the categories corresponding to the <a href="#configure-consent-settings" >category IDs</a> specified in the dashboard.</li>
<li><strong>OR</strong>: Allows the events to go to the destination if the end user consents to <strong>at least one</strong> of the categories corresponding to the <a href="#configure-consent-settings" >category IDs</a> specified in the dashboard.</li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="filter-events-based-on-consent">Filter events based on consent</h2><!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="javascript-sdk">JavaScript SDK</h3><p>You can set up your website depending on the following use cases:</p>
<table>
  <thead>
      <tr>
          <th>Use case</th>
          <th><div>Description</div></th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><a href="https://www.rudderstack.com/docs/data-governance/consent-management/custom-consent-manager/javascript/#post-consent-user-tracking" >Post-consent user tracking</a></td>
          <td>Call the <code>load</code> API of the JavaScript SDK <strong>only after</strong> the user has provided consent.</td>
      </tr>
      <tr>
          <td><a href="https://www.rudderstack.com/docs/data-governance/consent-management/custom-consent-manager/javascript/#pre-consent-user-tracking" >Pre-consent user tracking</a></td>
          <td>This approach is helpful in cases where you need to track some user activity and control the SDK and cookie behavior <strong>before</strong> and <strong>after</strong> the user provides their consent.</td>
      </tr>
  </tbody>
</table>
<p>See <a href="https://www.rudderstack.com/docs/data-governance/consent-management/custom-consent-manager/javascript/#pre-consent-user-tracking" >Custom Consent Management for Web</a> for the implementation details.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="android-kotlin-and-ios-swift-sdks">Android (Kotlin) and iOS (Swift) SDKs</h3><p>The Android (Kotlin) and iOS (Swift) SDKs support Custom consent management. Once you supply the user&rsquo;s consent choices, the SDKs:</p>
<ul>
<li><strong>Stamp every event</strong> with the user&rsquo;s consent state under <code>context.consentManagement</code>. Cloud mode destinations are then filtered server-side using that stamp.</li>
<li><strong>Block device mode destinations</strong> the user has not allowed. A denied destination is never initialized, and it receives no events.</li>
</ul>
<p>See <a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/client-side-features/consent-management/" >Consent Management in Mobile SDKs</a> and <a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/client-side-features/consent-management/setup/" >How to Enable Consent Management in Mobile SDKs</a> for the implementation details.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="other-sdks">Other SDKs</h3><p>For the other SDKs, RudderStack supports consent-based event filtering for a custom provider only in <strong>cloud mode</strong>. See the <a href="https://www.rudderstack.com/docs/data-governance/consent-management/support-matrix/" >Consent Management Support Matrix</a> for more information.</p>
<p>To filter events to your cloud mode destinations based on the user&rsquo;s consent, you need to add the <code>consentManagement</code> object within the context of the event payload. See <a href="https://www.rudderstack.com/docs/data-governance/consent-management/passing-consent/" >Add the Consent Object to Event Payloads</a> for more information.</p>
<br />

