Question: I'm seeing this error "Uncaught TypeError: w[l].push is not a function" in my Google Tag Manager javascript. What's going on?

I'm using the normal GTM script, and I've got a simple dataLayer defined:

```
<script>
  dataLayer = {
    "foo": "bar"
  }
</script>

```

Answer: 
dataLayer **must** be a list of objects, not an object.

<https://developers.google.com/tag-manager/devguide?hl=en>

Instead of:

```
<script>
  dataLayer = {
    "foo": "bar"
  }
</script>

```

Use:

```
<script>
  dataLayer = [{
    "foo": "bar"
  }]
</script>

```
May not be your case but I have seen this on my sites because I had a Adobe DTM DataLayer and also a GTM datalayer defined with the same name.

GTM datalayer object is an array were as the datalayer object in Adobe DTM is a json object.

To resolve this, I used a different variable(GTMDataLayer), this variable would replace the datalayer object used in gtag js for tracking.

I did face issue while using GTM datalayer object as in GTM datalayer object is an array were as the datalayer object in DTM is a json object.
So for GTM tracking I used a different variable(GTMDataLayer), this variable would replace the datalayer object used in gtag js for tracking.
Below is the code snippet.

```
<script async src="https://www.googletagmanager.com/gtag/js?id=DC- 
YOUR_ID_HERE&l=GTMDataLayer"></script>
<script>
window.**GTMDataLayer** = window.GTMDataLayer || [];
function gtag() { GTMDataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'DC-YOUR_ID_HERE);
</script>

```