{"id":135314,"date":"2025-03-15T14:00:52","date_gmt":"2025-03-15T14:00:52","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/gtmtips-data-layer-variable-versions-explained\/"},"modified":"2025-03-15T14:00:52","modified_gmt":"2025-03-15T14:00:52","slug":"gtmtips-data-layer-variable-versions-explained","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=135314","title":{"rendered":"#GTMTips: Data Layer Variable Versions Explained"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p><a href=\"https:\/\/tagmanager.google.com\/\">Google Tag Manager<\/a>\u2019s <a href=\"https:\/\/www.simoahava.com\/analytics\/data-layer\/\">Data Layer<\/a> is something I\u2019ve touched upon in pretty much all of my articles. It\u2019s such an integral part of what makes a tag management solution great and applicable to a host of business scenarios. I\u2019ve also talked at length about the internal data model of Google Tag Manager, and this <a href=\"https:\/\/www.simoahava.com\/categories\/gtm-tips\/\">#GTMTips<\/a> post is very much related to this rather murky concept.<\/p>\n<p>In this post, we\u2019ll go over the <strong>Data Layer Variable Version<\/strong> selection, and I\u2019ll try to explain just what this selector does.<\/p>\n<p>                <span class=\"simmer\"><br \/>\n  <span class=\"close\">X<\/span><\/p>\n<p>\n    <span class=\"fa fa-md fa-bell\"\/><br \/>\n    <strong>The Simmer Newsletter<\/strong>\n  <\/p>\n<p>\n    Subscribe to the <a href=\"https:\/\/www.simoahava.com\/newsletter\/\">Simmer newsletter<\/a> to get the latest news and content from Simo Ahava into your email inbox!\n  <\/p>\n<p>  <\/span><\/p>\n<h2 id=\"tip-40-the-two-faces-of-the-data-layer-variable\">Tip 40: The two faces of the Data Layer Variable<\/h2>\n<div style=\"aspect-ratio: 960 \/ 540;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2016\/01\/data-layer-variable-version.jpg\" title=\"Data Layer Variable Versions explained\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"540\" width=\"960\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2016\/01\/data-layer-variable-version.jpg#ZgotmplZ\" alt=\"Data Layer Variable Versions explained\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Let\u2019s start by taking a step back. As a technical construct, the \u201cData Layer\u201d in GTM is a <strong>JavaScript Array<\/strong>, which usually comprises a number of <strong>plain objects<\/strong> that have been pushed into its innards on a web page.<\/p>\n<div style=\"aspect-ratio: 1866 \/ 180;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2016\/01\/datalayer.jpg\" title=\"dataLayer\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"180\" width=\"1866\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2016\/01\/datalayer.jpg#ZgotmplZ\" alt=\"dataLayer\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>As you\u2019ve learned from my <a href=\"https:\/\/www.simoahava.com\/analytics\/google-tag-manager-data-model\/\">data model article<\/a>, GTM doesn\u2019t actually access this Array when you create your Data Layer Variables. Instead, when an object is pushed into <code>dataLayer<\/code>, it\u2019s made available to the data model of Google Tag Manager, and any Data Layer Variables you create will refer to these instances in the data model rather than directly accessing the Array itself.<\/p>\n<p>Why? To decouple the Array from the internal mechanisms of the connected platform (GTM in this case). This is quite important, as the less GTM needs to rely on the abstract structure of <code>dataLayer<\/code>, which could be manipulated at any time by either sloppy code or another connected platform, the better.<\/p>\n<p>Now, when you select the <strong>Version<\/strong> of the Data Layer Variable, you\u2019re instructing GTM to treat the values in the data model in two different ways.<\/p>\n<h3 id=\"version-1\">Version 1<\/h3>\n<p>Version 1 of the Data Layer Variable has a very limited reach. Basically, the key-value pair that is pushed into <code>dataLayer<\/code> needs to be in the root of the object, as Version 1 doesn\u2019t let you access nested keys.<\/p>\n<p>Here\u2019s an example of what would happen with a Version 1 Data Layer Variable that points to key name <code>'product.price'<\/code>:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#aaa;font-style:italic\">\/\/ Works because the dots are in the key name, and the key is in the root:\n<\/span><span style=\"color:#aaa;font-style:italic\"\/><span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  <span style=\"color:#a50\">'product.price'<\/span> : <span style=\"color:#a50\">'11.99'<\/span>\n});\n<span style=\"color:#aaa;font-style:italic\">\/\/ Won't work because 'price' is nested in the 'product' object:\n<\/span><span style=\"color:#aaa;font-style:italic\"\/><span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  <span style=\"color:#a50\">'product'<\/span> : {\n    <span style=\"color:#a50\">'price'<\/span> : <span style=\"color:#a50\">'11.99'<\/span>\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p>You could, though, access the nested object indirectly with a Version 1 Data Layer Variable by creating the variable for the key <code>'product'<\/code>, and then manipulating the returned object in a Custom HTML Tag or a Custom JavaScript Variable.<\/p>\n<p>And\u2026yeah. That\u2019s all that Version 1 does. There\u2019s no merging, no special data model functions, no nothing that you can use to further manipulate the retrieved object. So let\u2019s take a look at what happens when I push two different values for the same key (<code>'product'<\/code>):<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  <span style=\"color:#a50\">'product'<\/span> : {\n    <span style=\"color:#a50\">'price'<\/span> : <span style=\"color:#a50\">'11.99'<\/span>\n  }\n});\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  <span style=\"color:#a50\">'product'<\/span> : {\n    <span style=\"color:#a50\">'name'<\/span> : <span style=\"color:#a50\">'Tim Duncan Fan Club Membership'<\/span>\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p>In the example above, if I had my Version 1 Data Layer Variable pointing to <code>'product'<\/code>, it would return a plain object with <code>{'price' : '11.99'}<\/code> after the first push, and a plain object with <code>{'name' : 'Tim Duncan Fan Club Membership'}<\/code> after the second.<\/p>\n<p>In essence, any information in the first push <strong>is completely overwritten<\/strong> (for this particular Data Layer Variable) by the second push with the same key name (<code>'product'<\/code>).<\/p>\n<h3 id=\"version-2\">Version 2<\/h3>\n<p>If you want more flexibility, use Version 2 of the Data Layer Variable. This treats objects more like you\u2019d expect if you\u2019re familiar with how JavaScript works.<\/p>\n<p>Instead of bulldozing over existing keys, Version 2 first checks whether a key with that name already exists in the data model. If it does, it <strong>recursively merges<\/strong> information in the new push with information in the existing object.<\/p>\n<p>Let\u2019s see an example:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  <span style=\"color:#a50\">'product'<\/span> : {\n    <span style=\"color:#a50\">'price'<\/span> : <span style=\"color:#a50\">'119.99'<\/span>,\n    <span style=\"color:#a50\">'category'<\/span> : <span style=\"color:#a50\">'Membership'<\/span>\n  }\n});\n<span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  <span style=\"color:#a50\">'product'<\/span> : {\n    <span style=\"color:#a50\">'price'<\/span> : <span style=\"color:#a50\">'1199.99'<\/span>,\n    <span style=\"color:#a50\">'name'<\/span> : <span style=\"color:#a50\">'Tim Duncan Fan Club Membership'<\/span>\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p>So, let\u2019s say you\u2019re using Version 2 of the Data Layer Variable, and you\u2019re yet again pointing to the key with name <code>'product'<\/code>.<\/p>\n<p>After the first <code>dataLayer.push()<\/code>, the variable would return a plain object with:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\">{ \n  <span style=\"color:#a50\">'price'<\/span> : <span style=\"color:#a50\">'119.99'<\/span>, \n  <span style=\"color:#a50\">'category'<\/span> : <span style=\"color:#a50\">'Membership'<\/span>\n}\n<\/code><\/pre>\n<\/div>\n<p>After the second push, the contents would be:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\">{\n  <span style=\"color:#a50\">'price'<\/span> : <span style=\"color:#a50\">'1199.99'<\/span>, \n  <span style=\"color:#a50\">'category'<\/span> : <span style=\"color:#a50\">'Membership'<\/span>, \n  <span style=\"color:#a50\">'name'<\/span> : <span style=\"color:#a50\">'Tim Duncan Fan Club Membership'<\/span>\n}\n<\/code><\/pre>\n<\/div>\n<p>Can you see what happened here? Another object with the same key name (<code>'product'<\/code>) is pushed. Version 2 of the Data Layer Variable finds an instance of this key within the data model. Then, it recursively checks each key within this object to see if there are conflicts.<\/p>\n<p>First, it finds that <code>'price'<\/code> is in both objects, so there\u2019s a clash. Next, it checks if <code>'price'<\/code> is also a plain object or an Array to see if it should perform yet another merge deeper in the structure. However, the value of <code>'price'<\/code> is a String, which means that no recursive merge is performed, and the new value overwrites the old one.<\/p>\n<p>Next, it sees that <code>'category'<\/code> does not have any conflicts, so it leaves it be in the object. Finally, it finds a completely new key in the second push, <code>'name'<\/code>, and it merges this key into the existing object in the data model.<\/p>\n<p>So using Version 2 of the Data Layer Variable, resolution of conflicts in object key names is first attempted via a merge of the two objects, but if there are new \u201cprimitive\u201d values for any pre-existing keys, their values are overwritten just as they would be with Version 1 of the Data Layer Variable.<\/p>\n<h2 id=\"so-what\">So what?<\/h2>\n<p>This information could lead to a number of conclusions, but I\u2019m guessing many have the following two questions pop into their minds:<\/p>\n<ol>\n<li>\n<p>Why does the Version 1 still exist? Its numbering alone would mean that it\u2019s inferior.<\/p>\n<\/li>\n<li>\n<p>What on earth do I need recursive merge for?<\/p>\n<\/li>\n<\/ol>\n<p>One of the best use cases for Version 1 is with <a href=\"https:\/\/www.simoahava.com\/analytics\/enhanced-ecommerce-with-a-custom-javascript-variable\/\">Enhanced Ecommerce<\/a>. If you\u2019re using the <strong>Custom JavaScript Variable<\/strong> method, which I seem to use almost exclusively, you probably want to use Version 1 of the Data Layer when interacting with the <code>'ecommerce'<\/code> key. This way, GTM will only access the <em>most recent push<\/em> into <code>dataLayer<\/code>. And why is this significant? Take a look at the example below:<\/p>\n<div class=\"highlight\">\n<pre style=\"background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-javascript\" data-lang=\"javascript\"><span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  <span style=\"color:#a50\">'ecommerce'<\/span> : {\n    <span style=\"color:#a50\">'impressions'<\/span> : [{ ... impressions ... }]\n  }\n});\n<span style=\"color:#aaa;font-style:italic\">\/\/ Later on the same page\n<\/span><span style=\"color:#aaa;font-style:italic\"\/><span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  <span style=\"color:#a50\">'ecommerce'<\/span> : {\n    <span style=\"color:#a50\">'detail'<\/span> : { ... product detail view ... }\n  }\n});\n<span style=\"color:#aaa;font-style:italic\">\/\/ And yet later on the same page\n<\/span><span style=\"color:#aaa;font-style:italic\"\/><span style=\"color:#0aa\">window<\/span>.dataLayer.push({\n  <span style=\"color:#a50\">'ecommerce'<\/span> : {\n    <span style=\"color:#a50\">'add'<\/span> : { ... add to cart action ... }\n  }\n});\n<\/code><\/pre>\n<\/div>\n<p>If you used <strong>Version 2<\/strong> of the Data Layer Variable to send the Enhanced Ecommerce payload using the Custom JavaScript Variable method, you\u2019ll end up with <strong>three<\/strong> Impression payloads, <strong>two<\/strong> Product Detail Views, and <strong>one<\/strong> Add to Cart action. This is because of the <em>recursive merge<\/em> of the <code>'ecommerce'<\/code> object! I\u2019m guessing your intent is to only send each payload once.<\/p>\n<p>So, if you instead use <strong>Version 1<\/strong> of the Data Layer Variable to access the <code>'ecommerce'<\/code> object, GTM will only access the payload that was most recently pushed into <code>dataLayer<\/code>. This way you\u2019ll end up avoiding the payload multiplication problem.<\/p>\n<p>As for the second point of what recursive merge is good for, there\u2019s a whole universe of possibilities when it comes to merging of objects instead of overwriting previous instances. Examples include:<\/p>\n<ul>\n<li>\n<p>Updating an object as more information is revealed, e.g. collecting a history of interactions on a single page.<\/p>\n<\/li>\n<li>\n<p>Updating an object as more information becomes available, e.g. updating a \u201cuser\u201d object as certain API calls complete.<\/p>\n<\/li>\n<li>\n<p>Making a valid merge of two Enhanced Ecommerce payloads, such as combining <code>'impressions'<\/code> with an <code>'add'<\/code> object.<\/p>\n<\/li>\n<\/ul>\n<p>There are a host of other things you can do with Version 2 of the Data Layer Variable, and those are all detailed in my <a href=\"https:\/\/www.simoahava.com\/analytics\/google-tag-manager-data-model\/\">data model article<\/a>.<\/p>\n<p>I hope this has been illuminating, and I hope it helps you understand the rationale of having both versions available for the Data Layer Variable.<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Google Tag Manager\u2019s Data Layer is something I\u2019ve touched upon in pretty much all of my articles. It\u2019s such an integral part of what makes a tag management solution great and applicable to a host of business scenarios. I\u2019ve also talked at length about the internal data model of Google Tag Manager, and this #GTMTips [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":135315,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[11603,11385,14492,564,15112,28861],"dealstore":[],"offerexpiration":[],"class_list":["post-135314","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-data","tag-explained","tag-gtmtips","tag-layer","tag-variable","tag-versions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>#GTMTips: Data Layer Variable Versions Explained - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=135314\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"#GTMTips: Data Layer Variable Versions Explained - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"Google Tag Manager\u2019s Data Layer is something I\u2019ve touched upon in pretty much all of my articles. It\u2019s such an integral part of what makes a tag management solution great and applicable to a host of business scenarios. I\u2019ve also talked at length about the internal data model of Google Tag Manager, and this #GTMTips [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=135314\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-15T14:00:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/data-layer-variable-version.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=135314#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=135314\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"#GTMTips: Data Layer Variable Versions Explained\",\"datePublished\":\"2025-03-15T14:00:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=135314\"},\"wordCount\":1183,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=135314#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/data-layer-variable-version.jpg\",\"keywords\":[\"Data\",\"Explained\",\"GTMTips\",\"Layer\",\"variable\",\"Versions\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=135314#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=135314\",\"url\":\"https:\/\/fivemor.com\/?p=135314\",\"name\":\"#GTMTips: Data Layer Variable Versions Explained - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=135314#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=135314#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/data-layer-variable-version.jpg\",\"datePublished\":\"2025-03-15T14:00:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=135314#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=135314\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=135314#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/data-layer-variable-version.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/data-layer-variable-version.jpg\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=135314#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"#GTMTips: Data Layer Variable Versions Explained\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"#GTMTips: Data Layer Variable Versions Explained - Som2ny Network","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:\/\/fivemor.com\/?p=135314","og_locale":"en_US","og_type":"article","og_title":"#GTMTips: Data Layer Variable Versions Explained - Som2ny Network","og_description":"Google Tag Manager\u2019s Data Layer is something I\u2019ve touched upon in pretty much all of my articles. It\u2019s such an integral part of what makes a tag management solution great and applicable to a host of business scenarios. I\u2019ve also talked at length about the internal data model of Google Tag Manager, and this #GTMTips [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=135314","og_site_name":"Som2ny Network","article_published_time":"2025-03-15T14:00:52+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/data-layer-variable-version.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=135314#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=135314"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"#GTMTips: Data Layer Variable Versions Explained","datePublished":"2025-03-15T14:00:52+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=135314"},"wordCount":1183,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=135314#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/data-layer-variable-version.jpg","keywords":["Data","Explained","GTMTips","Layer","variable","Versions"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=135314#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=135314","url":"https:\/\/fivemor.com\/?p=135314","name":"#GTMTips: Data Layer Variable Versions Explained - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=135314#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=135314#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/data-layer-variable-version.jpg","datePublished":"2025-03-15T14:00:52+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=135314#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=135314"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=135314#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/data-layer-variable-version.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/data-layer-variable-version.jpg","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=135314#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"#GTMTips: Data Layer Variable Versions Explained"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/135314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=135314"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/135314\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/135315"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=135314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=135314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=135314"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=135314"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=135314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}