Resolving error dataLayer is not defined
<p>I have created Google Tag Manager data layer variable and published the container. When I access the page I get the error in Chrome console </p>

<pre><code>dataLayer is not defined
</code></pre>

<p>The datalayer push script is in the the HEAD element and the GTM code snippet is in the Body tag.</p>