For general data layer concepts, see Data Layers Explained
What the Data Layer Does
The data layer is a JavaScript array (window.dataLayer) that passes structured information from your website to Google Tag Manager. GTM reads this data and uses it to fire tags, populate variables, and send events to analytics platforms.
Initialization
Initialize the data layer before the GTM container script loads:
<script>
window.dataLayer = window.dataLayer || [];
</script>
<!-- GTM container script follows -->
Note: Google Sites does not support custom JavaScript. The data layer cannot be configured on Google Sites. See the GTM Setup guide for alternatives.