title: How to use Google Tag Manager in Node.js
body: <p>I'm pushing a simple ecommerce object to the Google Tag Manager <code>dataLayer</code> on the client side. It's working fine but I need to move this to the server.</p>
  
  <p>I found the <a href="https://github.com/googleapis/google-api-nodejs-client" rel="nofollow noreferrer">Google API Node.js Client Library</a> but it's still pretty young and I'm not able to find any working examples.</p>
  
  <p>Has anyone managed to do this? How would I accomplish the following using the google-api-nodejs-client in node.js?</p>
  
  <pre class="lang-js prettyprint-override"><code>dataLayer.push({
    event: 'purchase',
    user: 'user_1234',
    transactionId: 'trans_123',
    transactionAffiliation: 'Acme Clothing',
    transactionTotal: 11.99,
    transactionProducts: [
      {
        id: '1234',
        sku: 'SKU47',
        name: 'Fluffy Pink Bunnies',
        price: 11.99,
        quantity: 1
      }
    ]
  });
  </code></pre>