# Integrate JavaScript SDK v1.1 with your Ember.js app

<p>This guide will help you integrate RudderStack with your Ember.js app using the <a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/" >JavaScript SDK</a>. On successful integration, you can track and send real-time user events to your preferred destinations via RudderStack.</p>
<p>To set up the event stream on your Ember.js app, you need to perform the following steps:</p>
<ol>
<li><a href="#integrating-the-javascript-sdk-with-your-emberjs-app" >Integrate the JavaScript SDK with your Ember.js app and set up the tracking code</a></li>
<li><a href="#configuring-a-destination-in-rudderstack" >Configure a destination in RudderStack</a></li>
<li><a href="#deploying-your-emberjs-app-and-verifying-the-event-stream" >Deploy your Ember.js app and verify the events</a></li>
</ol>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="prerequisites">Prerequisites</h2><p>This guide assumes you have installed and set up your Ember.js app. Refer to the <a href="https://guides.emberjs.com/release/getting-started/quick-start/" >Ember.js documentation</a> for more information.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="integrating-the-javascript-sdk-with-your-emberjs-app">Integrating the JavaScript SDK with your Ember.js app</h2><p>Integrating the JavaScript SDK with your Ember.js app involves the following steps:</p>
<ol>
<li><a href="#creating-a-javascript-source-in-rudderstack" >Creating a JavaScript source in RudderStack</a></li>
<li><a href="#installing-and-configuring-the-javascript-sdk-in-your-app" >Installing and configuring the JavaScript SDK in your app</a></li>
</ol>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="creating-a-javascript-source-in-rudderstack">Creating a JavaScript source in RudderStack</h3><p>The RudderStack JavaScript source is required track the events from your Ember.js app. Follow these steps to set it up in your <a href="https://app.rudderstack.com/" >RudderStack dashboard</a>:</p>
<ol>
<li>Note the data plane URL in your RudderStack dashboard. This is required to set up the JavaScript SDK in your Ember.js app.</li>
</ol>

<figure class="image--main "  >
    <a 
         href="/docs/images/rs-cloud/data-plane-url.webp"
        
        >
        <img src="/docs/images/rs-cloud/data-plane-url.webp" 
         alt="Data Plane URL"  
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<ol start="2">
<li>Click the <strong>Sources</strong> button in the left navigation bar and select <strong>New Source</strong> to create a source. Under <strong>Sources</strong>, select <strong>Event Streams</strong> &gt; <strong>JavaScript</strong>.</li>
<li>Assign a name to your source and click <strong>Continue</strong>.</li>
<li>Your JavaScript source is now configured. Note down the write key for this source:</li>
</ol>

<figure class="image--main "  >
    <a 
         href="/docs/images/user-guides/jamstack-guides/write-key.webp"
        
        >
        <img src="/docs/images/user-guides/jamstack-guides/write-key.webp" 
         alt="JavaScript source write key"  
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="installing-and-configuring-the-javascript-sdk-in-your-app">Installing and configuring the JavaScript SDK in your app</h3><p>To integrate RudderStack with your Ember.js app and set up the tracking code, follow the steps below:</p>
<ol>
<li>In your Ember.js project folder, navigate to the <code>app</code> folder and open <code>index.html</code>.</li>
<li>Within the page&rsquo;s <code>&lt;body&gt;</code> section, include the following code snippet:</li>
</ol>
<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 = window.rudderanalytics = [];
      var methods = [
        &#34;load&#34;,
        &#34;page&#34;,
        &#34;track&#34;,
        &#34;identify&#34;,
        &#34;alias&#34;,
        &#34;group&#34;,
        &#34;ready&#34;,
        &#34;reset&#34;,
        &#34;getAnonymousId&#34;,
        &#34;setAnonymousId&#34;,
      ];
      for (var i = 0; i &lt; methods.length; i++) {
        var method = methods[i];
        rudderanalytics[method] = (function (methodName) {
          return function () {
            rudderanalytics.push(
              [methodName].concat(Array.prototype.slice.call(arguments))
            );
          };
        })(method);
      }
    
      rudderanalytics.load(&#34;WRITE_KEY&#34;,&#34;DATA_PLANE_URL&#34;);
      //rudderanalytics.page();
  &lt;/script&gt; 
  &lt;script src=&#34;https://cdn.rudderlabs.com/v1.1/rudder-analytics.min.js&#34;&gt;&lt;/script&gt;</code></pre></div>
</div>
<ol start="3">
<li>Replace <code>WRITE_KEY</code> and <code>DATA_PLANE_URL</code> with your JavaScript source write key and the data plane URL obtained in the <a href="#creating-a-javascript-source-in-rudderstack" >Creating a JavaScript source in RudderStack</a> section above.</li>
</ol>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">See the sample Ember.js app in the <a href="https://github.com/rudderlabs/rudder-samples/tree/master/javascript/sample-emberjs-app" >RudderStack Sample Applications</a> repository for more information.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="configuring-a-destination-in-rudderstack">Configuring a destination in RudderStack</h2><p>This section details the steps required to set up a destination in RudderStack, where you can send all events tracked by the JavaScript SDK you set up above.</p>
<ol>
<li>In your RudderStack dashboard, click <strong>Destinations</strong> &gt; <strong>New destination</strong>.</li>
<li>Choose your preferred destination from the list.</li>
<li>Assign a name to the destination and click <strong>Continue</strong>.</li>
<li>Select the JavaScript source configured in the above section and click <strong>Continue</strong>.</li>
<li>Configure the destination with the required settings.</li>
</ol>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">Optionally, you can add a <a href="https://www.rudderstack.com/docs/transformations/overview/" >user transformations</a> to this destination to transform your events.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="deploying-your-emberjs-app-and-verifying-the-event-stream">Deploying your Ember.js app and verifying the event stream</h2><p>To verify if your event stream is working correctly, deploy your Ember.js app and test if the events are tracked and delivered correctly. To do so, follow these steps:</p>
<ol>
<li>From your terminal, navigate to your Ember.js project&rsquo;s root folder and run the following command:</li>
</ol>
<div class="rs-code">
  <div class="rs-code__head">bash<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">ember serve</code></pre></div>
</div>
<ol start="2">
<li>Open the local server URL(generally <code>http://localhost:4200/</code>) in your browser to view the app.</li>
<li>Go to your browser&rsquo;s developer tools and check the <strong>Network</strong> tab to verify if the RudderStack JavaScript SDK (<code>rudder-analytics.js</code>) is loaded correctly. The following image highlights this option for the Google Chrome browser:</li>
</ol>

<figure class="image--main "  >
    <a 
         href="/docs/images/user-guides/browser-network-tab.webp"
        
        >
        <img src="/docs/images/user-guides/browser-network-tab.webp" 
         alt="Chrome Network tab"  
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<ol start="4">
<li>Click the various links or pages in your app for RudderStack to track these actions.</li>
<li>Go to the <strong>Live Events</strong> tab of your JavaScript source in the RudderStack dashboard to check if the events are tracked. Note that you may face a minor delay before the events start showing up in your dashboard.</li>
<li>Go to your destination to verify if the events are received successfully.</li>
</ol>
<br />

