{"id":226333,"date":"2024-07-26T18:44:15","date_gmt":"2024-07-26T18:44:15","guid":{"rendered":"https:\/\/datatrue.com\/?page_id=226333"},"modified":"2026-04-28T03:35:11","modified_gmt":"2026-04-28T03:35:11","slug":"a-guide-to-data-layers","status":"publish","type":"page","link":"https:\/\/datatrue.com\/en\/a-guide-to-data-layers\/","title":{"rendered":"A Guide to Data Layers 101"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; background_color=&#8221;#042A14&#8243; global_colors_info=&#8221;{}&#8221;][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h1 style=\"text-align: center;\"><span style=\"color: #ccffcc;\">A Guide to Data Layers<\/span><\/h1>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_row column_structure=&#8221;1_2,1_2&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;1_2&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text module_id=&#8221;Intro1&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; inline_fonts=&#8221;ABeeZee&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2><span style=\"color: #666666; font-family: ABeeZee; font-weight: normal;\">Introduction<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Data layers can be one of the more confounding elements of website analytics tracking. There&#8217;s plenty of background information to understand before you can confidently make proper use of them.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Our guide will give you everything you need to understand data layers, and the role they play in your analytics tracking.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It&#8217;s the perfect starting point for utilising data layers in your tag management system and analytics tools.<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][et_pb_column type=&#8221;1_2&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; background_color=&#8221;rgba(212,227,233,0.5)&#8221; background_enable_image=&#8221;off&#8221; custom_margin=&#8221;4px|||||&#8221; custom_padding=&#8221;23px|20px|23px|20px|true|true&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; sticky_enabled=&#8221;0&#8243;]<\/p>\n<h3>Table of Contents<\/h3>\n<h3><a href=\"#Intro1\"><span style=\"font-weight: 400; color: #008000;\"><span style=\"color: #339966;\">Introduction<\/span><\/span><\/a><\/h3>\n<h3><span style=\"font-weight: 400; color: #339966;\"><a href=\"#what1\" style=\"color: #339966;\">What is a data layer?<\/a><\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #339966;\"><a href=\"#what2\" style=\"color: #339966;\"><span style=\"font-weight: 400;\">Website layers explained<\/span><\/a><\/span><\/li>\n<\/ul>\n<h3><span style=\"color: #339966;\"><a href=\"#what3\" style=\"color: #339966;\"><span style=\"font-weight: 400;\">What are the benefits of a data layer?<\/span><\/a><\/span><\/h3>\n<h3><span style=\"color: #339966;\"><a href=\"#what4\" style=\"color: #339966;\"><span style=\"font-weight: 400;\">What does a data layer look like?<\/span><\/a><\/span><\/h3>\n<h3><span style=\"font-weight: 400; color: #339966;\">Dat<a href=\"#what5\" style=\"color: #339966;\">a layers for tag management<\/a><\/span><\/h3>\n<h3><span style=\"font-weight: 400; color: #339966;\">Ho<a href=\"#what6\" style=\"color: #339966;\">w to use a data layer in Google Tag Manager<\/a><\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #339966;\"><a href=\"#what7\" style=\"color: #339966;\"><span style=\"font-weight: 400;\">Add data layer code to your web page<\/span><\/a><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #339966;\"><a href=\"#what8\" style=\"color: #339966;\"><span style=\"font-weight: 400;\">Add information to the data layer<\/span><\/a><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #339966;\">\u00a0<a href=\"#what9\" style=\"color: #339966;\">Set up your data layer variable<\/a><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #339966;\">\u00a0<a href=\"#what10\" style=\"color: #339966;\">Configure tags with data layer variables<\/a><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #339966;\"><a href=\"#what11\" style=\"color: #339966;\"><span style=\"font-weight: 400;\">Set up trigger events<\/span><\/a><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #339966;\"><a href=\"#what11\" style=\"color: #339966;\"><span style=\"font-weight: 400;\">Preview and debug<\/span><\/a><\/span><\/li>\n<\/ul>\n<h3><span style=\"color: #339966;\"><a href=\"#what13\" style=\"color: #339966;\"><span style=\"font-weight: 400;\">Use DataTrue to secure your data layer<\/span><\/a><\/span><\/h3>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text module_id=&#8221;what1&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2><span style=\"font-weight: 400;\">What is a data layer?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">A data layer is a JavaScript universal data object used to collect, store and pass data on a website in a standardised way.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Data layers are useful as a master resource of the data on your site. Rather than connecting all your tools to various data sources on your site, you can connect them all to your data layer structure.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This ensures that your tools are drawing from the same source and are using the same information. As your analytics tech stack grows, the correct setup of your data layer becomes imperative to ensure you are leveraging your analytics for growth.<\/span><\/p>\n<p>.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;0px|||||&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text module_id=&#8221;what2&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;-21px|||||&#8221; custom_padding=&#8221;0px|||||&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3><span style=\"font-weight: 400;\">Website layers explained<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">To break down the function and purpose of a data layer, it&#8217;s helpful to look at the other layers of a website. Virtually every website has the 2 following layers:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Front-end:<\/b><span style=\"font-weight: 400;\"> Your site&#8217;s front-end is also known as the presentation layer or the client side. This refers to everything users see and can interact with when they click on your site. Forms, buttons, animations and menus all factor into your front-end. Your front end is usually created using HTML and CSS.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Back-end: <\/b><span style=\"font-weight: 400;\">This layer is also known as the application layer or the server side. It focuses on the functionality of your website and connects with tools like your tag management systems.<\/span><span style=\"font-weight: 400;\"><\/span><span style=\"font-weight: 400;\"><\/span><span style=\"font-weight: 400;\"><\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">A third layer found on many websites \u2013 though not all \u2013 is the data layer. The data layer removes the responsibility from one of the other layers to collect data and dedicates itself to that task.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">While it&#8217;s possible to use one of the other layers of a site to double as the data layer, this can lead to many issues.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For instance, using the front end of your site as the data layer can cause issues when changes to the site are made. You might have your data linked to particular design features of the site, affecting your data if any of these features are changed.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Having a dedicated data layer prevents any such issues from arising, keeping your data structure uniform and simplified.<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text module_id=&#8221;what3&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;-20px|||||&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2><span style=\"font-weight: 400;\">What are the benefits of a data layer?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">While adding a data layer to your site can cause some headaches, there are plenty of reasons to consider doing it. Some of the key benefits of data layers are:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Single source of data: <\/b><span style=\"font-weight: 400;\">For any website dealing with large amounts of complex data, working from one single source is essential since this allows for greater accuracy and flexibility.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Integration between applications: <\/b><span style=\"font-weight: 400;\">\u00a0Data layers facilitate the streamlined integration of any application that requires data from your site by acting as the singular source of primary data. Without a data layer, you may have to spend many hours going through individual applications and ensuring the same, correct data is being used.<\/span><span style=\"font-weight: 400;\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Easier quality assurance: <\/b><span style=\"font-weight: 400;\">Quality assurance is the bugbear of data analysts the world over. Having a single source of data to work with makes it much easier to check your data for any errors or holes. This allows you to move forward with your analytics strategy with confidence.<\/span><\/li>\n<\/ul>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;5px|||||&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text module_id=&#8221;what4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; border_color_all=&#8221;#10B981&#8243; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2><span style=\"font-weight: 400;\">What does a data layer look like?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Here is an example of what a data layer looks like:<\/span><\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">[<\/span><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0 \u00a0&#8220;gtm.start&#8221;: 1720739311646,<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0 &#8220;event&#8221;: &#8220;gtm.js&#8221;,<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0&#8220;gtm.uniqueEventId&#8221;: 1<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0},<\/span><span style=\"font-weight: 400;\">\u00a0 {<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0 &#8220;gtm.start&#8221;: 1720739311652,<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0&#8220;event&#8221;: &#8220;gtm.js&#8221;,<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">&#8220;gtm.uniqueEventId&#8221;: 3<\/span><span style=\"font-weight: 400;\">\u00a0},<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0{<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0 &#8220;OnetrustActiveGroups&#8221;: &#8220;,C0001,C0002,C0004,&#8221;<\/span><span style=\"font-weight: 400;\">\u00a0 },<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0 {<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0 &#8220;OptanonActiveGroups&#8221;: &#8220;,C0001,C0002,C0004,&#8221;<\/span><span style=\"font-weight: 400;\">\u00a0},<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0{<\/span><span style=\"font-weight: 400;\">\u00a0 \u00a0&#8220;event&#8221;: &#8220;OneTrustGroupsUpdated&#8221;,<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0 &#8220;OnetrustActiveGroups&#8221;: &#8220;,C0001,C0002,C0004,&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0&#8220;gtm.uniqueEventId&#8221;: 4<\/span><span style=\"font-weight: 400;\">\u00a0},<\/span><\/p>\n<p><span style=\"font-weight: 400;\">{<\/span><span style=\"font-weight: 400;\">\u00a0 &#8220;event&#8221;: &#8220;OneTrustLoaded&#8221;,<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0 &#8220;OnetrustActiveGroups&#8221;: &#8220;,C0001,C0002,C0004,&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0&#8220;gtm.uniqueEventId&#8221;: 5<\/span><span style=\"font-weight: 400;\">},<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0{<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">&#8220;event&#8221;: &#8220;OptanonLoaded&#8221;,<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0&#8220;OptanonActiveGroups&#8221;: &#8220;,C0001,C0002,C0004,&#8221;,<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0 &#8220;gtm.uniqueEventId&#8221;: 6<\/span><span style=\"font-weight: 400;\">\u00a0},<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8220;event&#8221;: &#8220;gtm.dom&#8221;,<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">&#8220;gtm.uniqueEventId&#8221;: 7<\/span><span style=\"font-weight: 400;\">\u00a0},<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">\u00a0{<\/span><span style=\"font-weight: 400;\">&#8220;event&#8221;: &#8220;gtm.load&#8221;,<\/span><\/p>\n<p>\u00a0<span style=\"font-weight: 400;\">&#8220;gtm.uniqueEventId&#8221;: 25<\/span><span style=\"font-weight: 400;\">\u00a0}<\/span>\u00a0<span style=\"font-weight: 400;\">]<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-weight: 400;\">Datlayer code is fairly simple. One major part of data layers is key\/value pairs.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Keys represent particular categories of data, while the value is the input. For instance, a streaming website might have keys for a movie&#8217;s title, genre or director.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The respective values for these keys might be &#8220;Citizen Kane&#8221;, &#8220;Drama&#8221; and &#8220;Orson Welles&#8221;.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">With this information in place, all relevant applications now have the same data to draw from.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Another common feature of data layers is events. Including events in your data layer makes it much easier to set up triggers on your tags.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Events in data layer code indicate when specific actions, such as a button being pressed, should cause tags to fire.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Common events you might include in your data layer include:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">&#8216;pageView&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">&#8216;addToCart&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">&#8216;purchaseComplete&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">&#8216;formSubmit&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">&#8216;buttonClick&#8217;<\/span><\/li>\n<\/ul>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text module_id=&#8221;what5&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;-26px|||||&#8221; border_color_all=&#8221;#000000&#8243; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2><span style=\"font-weight: 400;\">Data layers for tag management<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">So, how does a data layer affect the world of tag management?<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Firstly, you might find that your tag management software, such as Google Tag Manager, has automatically created a data layer on your website. If you don&#8217;t plan to use custom data on your website, this automatic layer should be fine for your purposes, and you won&#8217;t need to make any further changes.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, for more complex data processing and analysis, you will need to add extra information to this data layer. This is primarily done through the dataLayer.push() command.<\/span><\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">dataLayer.push({&#8216;event&#8217;: &#8216;event_name&#8217;})<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-weight: 400;\">Once keys and values have been stored in the data layer, they can be stored in variables. Variables can then be easily used in your tag management systems.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This command is also used to add event information to your data layer, telling your tags when they should fire.<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;1px|||||&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text module_id=&#8221;what6&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2><span style=\"font-weight: 400;\">How to use a data layer in Google Tag Manager<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">With the basics of data layers covered, let&#8217;s take a look at the steps to implementing and using a data layer in Google Tag Manager. Once you understand this process, it will become much simpler to use a data layer to send reliable, relevant data to your various analytics tools.<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text module_id=&#8221;what7&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;227.4px&#8221; custom_margin=&#8221;-7px|||||&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3><span style=\"font-weight: 400;\">Add data layer code to your web page<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">For maximum reliability and uniformity, it&#8217;s a good idea to enact data layer implementation on all pages. This can be achieved by adding data layer code into header files or other templates used on every page.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For the purposes of GTM, your data layer code can be as simple as the following:<\/span><\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">&lt;script&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">window.dataLayer = window.dataLayer || [];<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;\/script&gt;<\/span><\/p>\n<\/blockquote>\n<p>[\/et_pb_text][et_pb_code _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<script><!-- [et_pb_line_break_holder] -->hsadlsdjl<!-- [et_pb_line_break_holder] --><\/script>[\/et_pb_code][et_pb_text module_id=&#8221;what8&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3><span style=\"font-weight: 400;\">Add information to the data layer<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The most commonly used way to add information to your data layer is with the dataLayer.push() command. First, you must decide on your keys, or categories of data.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Common examples of keys for data layers include:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Page information, such as &#8216;pageType&#8217;, &#8216;pageTitle&#8217; or &#8216;pageCategory&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">User information, such as &#8216;userId&#8217;, &#8216;userType&#8217; or &#8216;userStatus&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">E-commerce transactions, such as &#8216;transactionId&#8217;, &#8216;transactionTotal&#8217; or &#8216;transactionProducts&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Geographic data, such as &#8216;userCountry&#8217;, &#8216;userRegion&#8217;, or &#8216;userCity&#8217;<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Then, within your code, include the value of each key. For instance, the value for &#8216;pageType&#8217; might be &#8216;homepage&#8217;.<\/span><\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">dataLayer.push({<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0pageType: &#8220;homepage&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">});<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-weight: 400;\">This same command is also used to add custom events to the data layer. You&#8217;ll use these custom events to set up your tag triggering later in GTM.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can even add custom event data in the same dataLayer.push() command as your keys and values to make triggering even smoother down the line.<\/span><\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">dataLayer.push({<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0pageType: &#8220;homepage&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0custom: &#8220;abcdef&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">});<\/span><\/p>\n<\/blockquote>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;-27px|auto||auto||&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text module_id=&#8221;what9&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3><span style=\"font-weight: 400;\">Set up your data layer variable<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Once information has been added to your data layer, you need a way to organise and access this data. This is achieved through data layer variables.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Normal variables in Google Tag Manager cannot be used to store custom data added to the data layer. You need to create data layer variables to achieve this.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can create a data layer variable with the following steps:<\/span><\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/datatrue.com\/wp-content\/uploads\/2024\/07\/GTM-DataLayer-Variable-Form.png&#8221; title_text=&#8221;GTM DataLayer Variable Form&#8221; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;-16px|||||&#8221; custom_padding=&#8221;3px|||||&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click Variables.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Under User-Defined Variables, click New.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click Variable Configuration and select Data Layer Variable.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enter the key in the Data Layer Variable Name field. Note that the key should be copied exactly as it is written in the code.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Set your Data Layer Version. Usually, it is best to leave this as Version 2.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Save the variable, and repeat these steps for other data layer keys you would like to have saved as variables.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Publish the container.<\/span><\/li>\n<\/ol>\n<p>[\/et_pb_text][et_pb_text module_id=&#8221;what10&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; border_color_all=&#8221;#10B981&#8243; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3><span style=\"font-weight: 400;\">Configure tags with data layer variables<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">With your variables created, you can now send data to other applications using your data layer variables.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The first step is to set tags for those applications in GTM. Common applications like Google Analytics and Facebook Pixel have built-in tag templates within GTM. Alternatively, you can create a custom HTML tag for the application you want to use.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Within Tag Configuration, you can add your data layer variable in the label or value field. Once added, you should be able to reference your data layer variable in various fields by selecting it from the Variable menu.<\/span><\/p>\n<p>[\/et_pb_text][et_pb_text module_id=&#8221;what11&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3><span style=\"font-weight: 400;\">Set up trigger events<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">With your tags ready to go, you need to set up triggers. This determines when tags are fired, sending data to your other tools like Google Analytics.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Follow these steps to establish triggering for your data layer tags:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click Triggers.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click New.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select &#8216;Custom Event&#8217; as the trigger type.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enter the event name, exactly as it appears in the dataLayer.push() command.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Define additional conditions if necessary.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">After defining the conditions, click Save to store your trigger settings. Give your trigger a meaningful name for easy identification.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to the Tags section and choose the tag you have configured.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click Triggering and select the trigger you&#8217;ve just created.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Before publishing your changes, test to ensure the tag is working properly (see the following step).<\/span><\/li>\n<\/ol>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/datatrue.com\/wp-content\/uploads\/2024\/07\/GTM-Custom-Event-Trigger-Form.png&#8221; title_text=&#8221;GTM Custom Event Trigger Form&#8221; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text module_id=&#8221;what12&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3><span style=\"font-weight: 400;\">Preview and debug<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Before publishing any changes, you must carefully test the tags and triggers you have created. Thankfully, GTM&#8217;s preview and debug mode make it easy to do that.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Follow these steps to ensure your data layer tags and triggers are functioning as intended before you roll them out.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click Preview to activate preview and debug mode.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In another tab, open your website.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The GTM debug pane should now appear on your site.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Perform actions on your site to trigger custom events.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Identify any tags that are misfiring or not firing at all, and any variables that are not showing the correct values. Check out our<\/span><a href=\"https:\/\/datatrue.com\/en\/guide-to-tag-auditing\/\"> <span style=\"font-weight: 400;\">guide to tag auditing<\/span><\/a><span style=\"font-weight: 400;\"> for troubleshooting tips.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Perform tests across various pages and interaction types.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Exit preview mode and publish the changes you have made.<\/span><\/li>\n<\/ol>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/datatrue.com\/wp-content\/uploads\/2024\/07\/GTM-Start-Preview-mode-to-test-new-tag.png&#8221; title_text=&#8221;GTM Start Preview mode to test new tag&#8221; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p><span style=\"font-weight: 400;\">And with that, you have successfully used the data layer in Google Tag Manager. You now have a single source of data for various applications to draw on, and you have set up the necessary tags and triggers to disseminate your data.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You&#8217;re one step closer to being assured that your organisation has all the information it needs to thrive.<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;12px|||||&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text module_id=&#8221;what13&#8243; _builder_version=&#8221;4.17.3&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;0px|||||&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h2><span style=\"font-weight: 400;\">Use DataTrue to secure your data layer<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Using a data layer is the best practice for data control and use in your tags. However, your heavy reliance on this single object can lead to serious issues if your data is unreliable or if the layer breaks.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This is where DataTrue&#8217;s<\/span><a href=\"https:\/\/datatrue.com\/en\/automated-data-layer-testing\/\"> <span style=\"font-weight: 400;\">automated data layer testing<\/span><\/a><span style=\"font-weight: 400;\"> comes in. It&#8217;s easy to begin setting up validation tests and quickly uncovering any issues that are arising with regard to your data layer. This ensures the correct data is sitting in your data layer and being passed to your tags.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Automated data layer testing is just one form of<\/span><a href=\"https:\/\/datatrue.com\/en\/web-analytics-testing\/\"> <span style=\"font-weight: 400;\">web analytics testing<\/span><\/a><span style=\"font-weight: 400;\"> DataTrue offers.<\/span><a href=\"https:\/\/datatrue.zohobookings.com\/#\/customer\/demo\"> <span style=\"font-weight: 400;\">Book a demo with DataTrue<\/span><\/a><span style=\"font-weight: 400;\"> today to discover how your data layer can be secured and provide data you can count on.<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Guide to Data LayersIntroduction Data layers can be one of the more confounding elements of website analytics tracking. There&#8217;s plenty of background information to understand before you can confidently make proper use of them. Our guide will give you everything you need to understand data layers, and the role they play in your analytics [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-226333","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What Is a Data Layer? Implementation &amp; Testing Guide | DataTrue<\/title>\n<meta name=\"description\" content=\"A data layer standardises website data for analytics and tag management. Learn what it is, how to set it up in GTM, and how to test it&#039;s working correctly.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/datatrue.com\/en\/a-guide-to-data-layers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What Is a Data Layer? Implementation &amp; Testing Guide | DataTrue\" \/>\n<meta property=\"og:description\" content=\"A data layer standardises website data for analytics and tag management. Learn what it is, how to set it up in GTM, and how to test it&#039;s working correctly.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/datatrue.com\/en\/a-guide-to-data-layers\/\" \/>\n<meta property=\"og:site_name\" content=\"DataTrue\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/datatruedigital\/\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-28T03:35:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/datatrue.com\/wp-content\/uploads\/2022\/04\/New-DT-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1328\" \/>\n\t<meta property=\"og:image:height\" content=\"208\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@data_true\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/a-guide-to-data-layers\\\/\",\"url\":\"https:\\\/\\\/datatrue.com\\\/en\\\/a-guide-to-data-layers\\\/\",\"name\":\"What Is a Data Layer? Implementation & Testing Guide | DataTrue\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/#website\"},\"datePublished\":\"2024-07-26T18:44:15+00:00\",\"dateModified\":\"2026-04-28T03:35:11+00:00\",\"description\":\"A data layer standardises website data for analytics and tag management. Learn what it is, how to set it up in GTM, and how to test it's working correctly.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/a-guide-to-data-layers\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/datatrue.com\\\/en\\\/a-guide-to-data-layers\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/a-guide-to-data-layers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/datatrue.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Guide to Data Layers 101\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/datatrue.com\\\/en\\\/\",\"name\":\"DataTrue\",\"description\":\"Web Analytics Quality Assurance\",\"publisher\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/datatrue.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/#organization\",\"name\":\"DataTrue\",\"url\":\"https:\\\/\\\/datatrue.com\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/datatrue.com\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/New-DT-Logo.png\",\"contentUrl\":\"https:\\\/\\\/datatrue.com\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/New-DT-Logo.png\",\"width\":1328,\"height\":208,\"caption\":\"DataTrue\"},\"image\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/datatruedigital\\\/\",\"https:\\\/\\\/x.com\\\/data_true\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/Datatrue\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What Is a Data Layer? Implementation & Testing Guide | DataTrue","description":"A data layer standardises website data for analytics and tag management. Learn what it is, how to set it up in GTM, and how to test it's working correctly.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/datatrue.com\/en\/a-guide-to-data-layers\/","og_locale":"en_US","og_type":"article","og_title":"What Is a Data Layer? Implementation & Testing Guide | DataTrue","og_description":"A data layer standardises website data for analytics and tag management. Learn what it is, how to set it up in GTM, and how to test it's working correctly.","og_url":"https:\/\/datatrue.com\/en\/a-guide-to-data-layers\/","og_site_name":"DataTrue","article_publisher":"https:\/\/www.facebook.com\/datatruedigital\/","article_modified_time":"2026-04-28T03:35:11+00:00","og_image":[{"width":1328,"height":208,"url":"https:\/\/datatrue.com\/wp-content\/uploads\/2022\/04\/New-DT-Logo.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@data_true","twitter_misc":{"Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/datatrue.com\/en\/a-guide-to-data-layers\/","url":"https:\/\/datatrue.com\/en\/a-guide-to-data-layers\/","name":"What Is a Data Layer? Implementation & Testing Guide | DataTrue","isPartOf":{"@id":"https:\/\/datatrue.com\/en\/#website"},"datePublished":"2024-07-26T18:44:15+00:00","dateModified":"2026-04-28T03:35:11+00:00","description":"A data layer standardises website data for analytics and tag management. Learn what it is, how to set it up in GTM, and how to test it's working correctly.","breadcrumb":{"@id":"https:\/\/datatrue.com\/en\/a-guide-to-data-layers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/datatrue.com\/en\/a-guide-to-data-layers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/datatrue.com\/en\/a-guide-to-data-layers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/datatrue.com\/en\/"},{"@type":"ListItem","position":2,"name":"A Guide to Data Layers 101"}]},{"@type":"WebSite","@id":"https:\/\/datatrue.com\/en\/#website","url":"https:\/\/datatrue.com\/en\/","name":"DataTrue","description":"Web Analytics Quality Assurance","publisher":{"@id":"https:\/\/datatrue.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/datatrue.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/datatrue.com\/en\/#organization","name":"DataTrue","url":"https:\/\/datatrue.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/datatrue.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/datatrue.com\/wp-content\/uploads\/2022\/04\/New-DT-Logo.png","contentUrl":"https:\/\/datatrue.com\/wp-content\/uploads\/2022\/04\/New-DT-Logo.png","width":1328,"height":208,"caption":"DataTrue"},"image":{"@id":"https:\/\/datatrue.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/datatruedigital\/","https:\/\/x.com\/data_true","https:\/\/www.youtube.com\/c\/Datatrue"]}]}},"_links":{"self":[{"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/pages\/226333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/comments?post=226333"}],"version-history":[{"count":0,"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/pages\/226333\/revisions"}],"wp:attachment":[{"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/media?parent=226333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}