If you work in digital marketing, you may have heard the term 'data layer' being thrown around a lot by the technical personnel. But what exactly is a data layer and why is it so important? We can think of the data layer as a part of a multi-layered structure that makes up many websites and apps. When it comes to online properties you are using for lead generation and e-commerce, there are usually three layers:
1. The Presentation Layer
This is the layer that the user sees and interacts directly with. It's where the user interface is and is developed using frontend technologies such as HTML and CSS.
2. The Application Layer
This concerns the logic, data exchange, and functionalities of the site or app, especially with respect to third-party tools satisfying your business needs. This is the layer where analytics software (e.g. Mixpanel) or marketing vendors (e.g. Google Ads) are connected to your site.
3. The Data Layer
Not all websites or applications resemble a multi-layered cake, and not every site requires a data layer. But web analytics are important for enterprises with some kind of a measurable objective. The data layer is therefore generally crucial to have in such cases and is useful in tandem with a tag management solution such as Google Tag Manager.
That sounds fine, but where can I actually see an example of a "data layer"?
Now, let's try to do something as someone who is pretending (or not pretending!) to eventually make a purchase. Add a product to the cart, then view your shopping cart. Check the data layer again by typing 'dataLayer' in the console.
As you can see, data from your add-to-cart action is now being expressed in the data layer. We can see, for example that I'm on the "shopping_cart" page, that I'm in the "US" region, I'm not logged in, and that the items in my cart total $729.98. You can also apparently see that I do not meet the Lego definition of a 'vip', whatever that is. 😭🤣
Why is it important that you are able to use the data layer to see data? Well, if you're running an e-commerce business, you might want to capture all that data for your strategic analyses as well as to enable your marketing platforms to optimize on such data.
Now that you know what the data layer is, we can begin discussing how we can work with it to achieve our enterprise goals - all to be covered in other posts.