title: EventCallback for dataLayer in google tag
body: <p>I want to send some event using dataLayer.push.
  Here is what i try:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script&gt;
      dataLayer = [];
      ga_data = JSON.parse('{{ga_data|safe}}');
      ga_data.eventCategory = 'Test Event Callback';
      ga_data.eventCallback = function () {
        var href = "{{ href }}";
        if((href.substring(0, 4) !== 'http') &amp;&amp; (href.substring(0, 2) !== '//'))href = '//' + href;
        alert('sdf');
        window.location = href;
      }
      dataLayer.push(ga_data);
  
  &lt;/script&gt;
  
    &lt;script&gt;(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&amp;l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','some id');&lt;/script&gt;
  
    &lt;noscript&gt;&lt;iframe src="https://www.googletagmanager.com/ns.html?id=some-id" height="0" width="0" style="display:none;visibility:hidden"&gt;&lt;/iframe&gt;&lt;/noscript&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>So I want to fire callback after event has been sent.
  First i get some ga_data object from json which already has eventAction, eventLabel and eventCategory set.</p>
  
  <p>Then I try to append eventCallback to my ga_data and push it to dataLayer.</p>
  
  <p>But it seems that eventCallback does not fire at all.</p>
  
  <p>EDIT:
  ga_data inside JSON.parse returns me valid json. If i try to console.log ga_data just before pushing it to dataLayer I get this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{eventCategory: "Test Event Callback", eventAction: "SINN", eventCallback: ƒ}</code></pre>
  </div>
  </div>
  </p>