title: Google Tag Manager Multiple Enhanced eCommerce Events
body: <p>I'm new to GTM and I'm having trouble trying to submit 2 enhanced ecommerce events in the dataLayer. Only the last event seems to be getting sent when I check on Google Analytics.</p>
  
  <p>I've come across <a href="http://www.simoahava.com/analytics/ecommerce-tips-google-tag-manager/" rel="nofollow">http://www.simoahava.com/analytics/ecommerce-tips-google-tag-manager/</a> which, just before the summary, seems to sum up what I've said regarding it only submitting the last one.</p>
  
  <pre><code>    dataLayer.push({
          'event': 'addToCart',
          'ecommerce': {
              'currencyCode': 'GBP',
              'add': {
                  'products': dataLayerProducts
              }
          }
      });
      dataLayer.push({
          'event': 'checkout',
          'ecommerce': {
              'checkout': {
                  'actionField': {'step': 1},
                  'products': dataLayerProducts
              }
          }
      });
  </code></pre>
  
  <p>Only the checkout will be registered with Analytics. I've tried things like the following:</p>
  
  <pre><code>    dataLayer = [{
          'event': 'checkout',
          'event': 'addToCart',
          'ecommerce': {
              'add': {
                  'products': dataLayerProducts
              },
              'checkout': {
                  'actionField': {'step': 1},
                  'products': dataLayerProducts
              }
          }
      }];
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    dataLayer = [{
          'event': 'addToCart',
          'ecommerce': {
              'add': {
                  'products': dataLayerProducts
              },
          }
      }, {
          'event': 'checkout',
          'ecommerce': {
              'checkout': {
                  'actionField': {'step': 1},
                  'products': dataLayerProducts
              }
          }
      }];
  </code></pre>
  
  <p>But I've had no luck doing it like that either. If it just isn't possible, any helpful workarounds would be much appreciated.</p>
  
  <p><strong>UPDATE WITH NEW CODE:</strong>
  Still only sending the last event (checkout). Code appears immediately after the opening <code>&lt;body&gt;</code> tag.</p>
  
  <pre><code>&lt;script&gt;
  dataLayer = [];
  dataLayerProducts = [];
  dataLayerProducts.push({
      'name': 'Product Name',
      'id': 'SKU',
      'price': '29.95',
      'brand': 'Brand',
      'category': 'Some/Category',
      'quantity': 1
  });
  dataLayer.push({
      'event': 'addToCart',
      'ecommerce': {
          'add': {
              'products': dataLayerProducts
          },
      }
  });
  dataLayer.push({
      'event': 'checkout',
      'ecommerce': {
          'checkout': {
              'actionField': {'step': 1},
              'products': dataLayerProducts
          }
      }
  });
  &lt;/script&gt;
  &lt;!-- Google Tag Manager --&gt;
  // Code
  &lt;!-- End Google Tag Manager --&gt;
  </code></pre>