dataLayer.push not working after GTM script
I want to implement the Enhanced Ecommerce with Google Tag Manager and I want to push some data for the tag Universal Analytics. I always created the dataLayer before the GTM script, but now I need to send other data with dataLayer.push And it doesn't work, datalaLayer.push only works if I do it just before the GTM script starts. Example. This works: <script> <head> dataLayer = [{ 'google_tag_params': { 'ecomm_pagetype': 'category', 'ecomm_category': '{{ $resource->seo->h1 }}', } }]; dataLayer.push({ 'ecommerce': { 'currencyCode': 'EUR', 'impressions': [ { 'id': '12312', 'price': 24, 'category