# Other Amplitude Features

<p>After you <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/amplitude/setup-guide/" >set up Amplitude as a destination</a> and send events in <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/amplitude/device-mode/" >JavaScript device mode</a>, you can optionally add Amplitude Guides &amp; Surveys and Experiment in your application.</p>
<p>These features run in the browser alongside the Amplitude Analytics instance that RudderStack loads in device mode. Amplitude Guides &amp; Surveys requires Browser SDK version <strong>2</strong> — Experiment needs no additional RudderStack destination settings.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="guides--surveys">Guides &amp; Surveys</h2><p><a href="https://amplitude.com/docs/sdks/guides-and-surveys/sdk#amplitude-browser-sdk-2" >Amplitude Guides &amp; Surveys</a> lets you deliver in-product guides and surveys through the Amplitude Engagement bundle.</p>
<p>Note that:</p>
<ul>
<li>Your Amplitude destination <strong>must</strong> use JavaScript device mode with <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/amplitude/device-mode/#amplitude-browser-sdk-version" >Amplitude Browser SDK version <strong>2</strong></a>.</li>
<li>Register Guides &amp; Surveys as a plugin on the same Amplitude Analytics instance so device, user, and session identity stay continuous — <strong>do not load a second Amplitude Analytics SDK</strong>.</li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="setup-guides-and-surveys">Setup</h3><ol>
<li>Set your Amplitude destination to <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/amplitude/device-mode/" >JavaScript device mode</a> and select <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/amplitude/device-mode/#amplitude-browser-sdk-version" >Amplitude Browser SDK version <strong>2</strong></a>.</li>
<li>Load <code>https://cdn.amplitude.com/script/AMPLITUDE_API_KEY.engagement.js</code> using the <strong>same</strong> Amplitude project API key configured in the RudderStack destination.</li>
<li>Because Amplitude Analytics is already loaded and initialized, load the Engagement bundle and register the plugin <strong>after</strong> <code>rudderanalytics.ready()</code>.</li>
</ol>

<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text"><p>Do not:</p>
<ul>
<li>Call another <code>amplitude.init()</code>, <code>engagement.init()</code>, or <code>engagement.boot()</code> — <code>amplitude.add(window.engagement.plugin())</code> handles initialization.</li>
<li>Run a second, standalone Amplitude Analytics SDK on the page.</li>
</ul></div>
  </div>
</blockquote>
<p>A sample CDN setup is shown below. Replace <code>AMPLITUDE_API_KEY</code> with your Amplitude project API key:</p>
<div class="rs-code">
  <div class="rs-code__head">html<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-html" data-lang="html">&lt;script&gt;
  rudderanalytics.ready(function () {
    var script = document.createElement(&#39;script&#39;);
    script.src =
      &#39;https://cdn.amplitude.com/script/AMPLITUDE_API_KEY.engagement.js&#39;;
    script.onload = function () {
      amplitude.add(window.engagement.plugin());
    };
    document.head.appendChild(script);
  });
&lt;/script&gt;</code></pre></div>
</div>

<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text"><p>If your Amplitude destination uses a <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/amplitude/setup-guide/#javascript" >Proxy server URL</a> (custom <code>serverUrl</code>), do <strong>not</strong> use the Browser SDK plugin path above. Amplitude&rsquo;s Guides &amp; Surveys plugin does not support proxy configuration.</p>
<p>Follow Amplitude&rsquo;s <a href="https://amplitude.com/docs/sdks/guides-and-surveys/sdk#standalone-installation-other-amplitude-sdks-third-party-analytics-providers-and-proxy-setups" >standalone Guides &amp; Surveys installation</a> and <a href="https://amplitude.com/docs/guides-and-surveys/proxy" >proxy configuration</a> instead.</p>
</div>
  </div>
</blockquote>
<p>See Amplitude&rsquo;s <a href="https://amplitude.com/docs/sdks/guides-and-surveys/sdk#amplitude-browser-sdk-2" >Guides and Surveys Web SDK</a> documentation for full options and troubleshooting.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="experiment">Experiment</h2><p>Your application loads and initializes <a href="https://amplitude.com/docs/sdks/experiment-sdks/experiment-javascript" >Amplitude Experiment</a>. It requires <strong>no</strong> additional RudderStack-side integration changes.</p>
<p>When you use Amplitude Analytics through RudderStack JavaScript device mode, you can initialize Experiment with Amplitude&rsquo;s built-in analytics integration so it shares identity with the Analytics SDK instance on the page.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="setup-experiment">Setup</h3><ol>
<li>Load the Amplitude Experiment JavaScript client in your application.</li>
<li>Initialize it with a deployment key from the <strong>same</strong> Amplitude project you use for analytics.</li>
<li>Fetch or start the Experiment client and read variants according to Amplitude&rsquo;s current <a href="https://amplitude.com/docs/sdks/experiment-sdks/experiment-javascript" >Experiment SDK documentation</a>.</li>
</ol>
<p>A sample CDN setup is shown below. Replace <code>DEPLOYMENT_KEY</code> with your Amplitude Experiment deployment key:</p>
<div class="rs-code">
  <div class="rs-code__head">html<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-html" data-lang="html">&lt;script src=&#34;https://unpkg.com/@amplitude/experiment-js-client@1.15.5/dist/experiment.umd.js&#34;&gt;&lt;/script&gt;
&lt;script&gt;
  // Replace DEPLOYMENT_KEY with an Amplitude Experiment deployment key
  // from the same Amplitude project used for analytics.
  window.experiment =
    Experiment.initializeWithAmplitudeAnalytics(&#39;DEPLOYMENT_KEY&#39;);
&lt;/script&gt;</code></pre></div>
</div>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">If your site uses a consent management platform, gate Experiment initialization and variant fetching until the user grants consent. Amplitude&rsquo;s Experiment SDK does not provide a separate consent API — see <a href="https://amplitude.com/docs/sdks/experiment-sdks/experiment-javascript#manage-user-consent" >Manage user consent</a> in Amplitude&rsquo;s documentation.</div>
  </div>
</blockquote>

</html>
<p>See Amplitude&rsquo;s <a href="https://amplitude.com/docs/sdks/experiment-sdks/experiment-javascript" >Experiment JavaScript SDK</a> documentation for fetch, start, and variant evaluation details.</p>
<br />

