What is data layers in Google Tag Manager?

A data layer is  used to describe information that isn’t available as part of DOM (Document Object Model) or any other JavaScript variables. When you set up your website or mobile app to work with Tag Manager and a data layer, think about what categories of information the data layer should handle, such as:

Product data: Product name, price, category
Marketing campaign information: Traffic source, medium
Transaction data: Cart value, checkout date
Customer information: New or returning customer

Data layer variables enable Tag Manager to read values from your data layer implementation and pass those values to tags, triggers, and other variables. A data layer object is made up of a list of key/value pairs. A key is a category of things – a book's category, title, or author. Each key could have different values. A book's title key could have a value of 'Ulysses', 'War and Peace', 'A Brief History of Time', etc.