title: Google Analytics Web+App event config: Error 'gtag is not defined'
body: <p>I'm trying to setup ecommerce event configuration of Google Analytics App+Web for a website. Refer to the documentation <a href="https://developers.google.com/analytics/devguides/collection/app-web/ecommerce" rel="noreferrer">here</a>.</p>
  
  <p>Because there is a lot of custom code for the ecommerce configuration, I cannot use the general GA App+Web webevent template, so instead I'm using a custom HTML-tag in this case.</p>
  
  <p>As a first test, I tried to fire the following simple event:</p>
  
  <pre><code>&lt;script&gt;
  
    gtag('event', 'blabla', {
    'test_param1': 'test_value_1'
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>However, the event is not correctly sent to GA; instead, the following error in the console is returned:</p>
  
  <p><em>Uncaught ReferenceError: gtag is not defined</em></p>
  
  <p>To reproduce, see the following page: <a href="https://www.hema.nl/mooi-gezond/make-up/make-up-accessoires/toilettassen-1/toilettas-11830901.html" rel="noreferrer">https://www.hema.nl/mooi-gezond/make-up/make-up-accessoires/toilettassen-1/toilettas-11830901.html</a></p>
  
  <p>Additional information:</p>
  
  <ul>
  <li>The GA App+Web base initialization is (successfully) done via GTM, via the GA App+Webconfiguration template tag.</li>
  <li>I also configured a few other (simple non-ecommerce) GA App+Web events via GTM via the GA App+Web webevent template tag , and these events are sent to GA successfully. </li>
  </ul>
  
  <p>Does anyone know what's going wrong, why the console error appears and why the event is not sent to GA?</p>