cccnrc
cccnrc

Reputation: 1249

explanation of "window.dataLayer || []"

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?

Upvotes: 0

Views: 33

Answers (0)

Related Questions