explanation of "window.dataLayer || []"

35 views Asked by At

I am trying to understand what exactly:

  window.dataLayer = window.dataLayer || [];

means in gtag() initialization as per google instructions

Does it assign window.dataLayer the object window.dataLayer or an empty array in case it does not exists?

0

There are 0 answers