title: Google Tag manager dataLayer push not storing object
body: <p>I've read through several SO posts and the <a href="https://developers.google.com/tag-manager/devguide" rel="nofollow noreferrer">docs</a> and <a href="https://developers.google.com/tag-manager/reference" rel="nofollow noreferrer">api</a>. My understanding is that the <code>dataLayer</code> global object should behave Array-like and increase in size when you <code>.push()</code> an event object into it. According to the screenshot <a href="https://stackoverflow.com/a/20078488/630752">here</a>.</p>
  
  <p>My dataLayer object does not grow like this. It exists on the window and I can run</p>
  
  <pre><code>dataLayer.push({'event': 'trackEvent'});
  </code></pre>
  
  <p>without error, except that it does not increase the size of dataLayer.</p>
  
  <p>Other than the array growing and how else can I tell if <code>.push()</code> is working or not?</p>
  
  <p>Should the browser perform an xhr request when events are detected?</p>
  
  <p>Does the GTM script perform client-side logic based off of GTM settings (tags/triggers) before sending them to google? i.e., are the events not pushing because they don't pass validation.</p>
  
  <p>Does it matter if I'm testing this on localhost?</p>
  
  <p>How do I fix this?</p>
  
  <p><a href="https://i.stack.imgur.com/bdW0V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bdW0V.png" alt="Google tag assistant extension"></a>
  <a href="https://i.stack.imgur.com/5ZskZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5ZskZ.png" alt="enter image description here"></a></p>