{"id":103108,"date":"2025-02-22T09:29:44","date_gmt":"2025-02-22T09:29:44","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/gtmtips-search-datalayer-for-a-key-value-pair\/"},"modified":"2025-02-22T09:29:44","modified_gmt":"2025-02-22T09:29:44","slug":"gtmtips-search-datalayer-for-a-key-value-pair","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=103108","title":{"rendered":"#GTMTips: Search dataLayer For A Key-Value Pair"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>One of the difficulties of working with <a href=\"https:\/\/tagmanager.google.com\/\">Google Tag Manager<\/a> and the <a href=\"https:\/\/www.simoahava.com\/analytics\/data-layer\/\"><code>dataLayer<\/code> structure<\/a> is that GTM doesn\u2019t preserve <strong>history<\/strong> of the items collected into its <a href=\"https:\/\/www.simoahava.com\/analytics\/google-tag-manager-data-model\/\">data model<\/a>. Or, at least, it doesn\u2019t preserve it in a manner that would let us access it.<\/p>\n<p>This is typically a very niche problem, but it does surface every now and then. For example, say you wanted to query whether an <code>event<\/code> with some specific value has already been pushed into <code>dataLayer<\/code>. Well, this is impossible, since any <code>event<\/code> you use to trigger this check would overwrite this previous <code>event<\/code> value in the data model (since any given key can only have one value at a time).<\/p>\n<p>In other words, we need a mechanism that lets us query for <strong>earlier<\/strong> values of specific keys which have been (possibly) overwritten since then. For this, we\u2019ll need some Custom JavaScript variable magic.<\/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-91-looking-for-key-value-pairs\">Tip 91: Looking for key-value pairs<\/h2>\n<div style=\"aspect-ratio: 960 \/ 540;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/11\/search-datalayer-for-key-value-pair.jpg\" title=\"Search dataLayer for key-value pair\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"540\" width=\"960\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/11\/search-datalayer-for-key-value-pair.jpg#ZgotmplZ\" alt=\"Search dataLayer for key-value pair\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>First, create the Custom JavaScript variable. This is the code you\u2019ll need to add:<\/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:#00a\">function<\/span>() {\n  <span style=\"color:#aaa;font-style:italic\">\/\/ Modify the searchObject below.\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#aaa;font-style:italic\">\/\/\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#aaa;font-style:italic\">\/\/ Add each key-value pair you want to look for directly into the searchObject object. Use\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#aaa;font-style:italic\">\/\/ strings for keys. \n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#aaa;font-style:italic\">\/\/\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#aaa;font-style:italic\">\/\/ The variable will look for any key-value pair you specify, and return true if any one of them\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#aaa;font-style:italic\">\/\/ is found. If you use dot notation, the variable will try to find a key with this name first,\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#aaa;font-style:italic\">\/\/ after which it will parse the nested structure looking for a match.\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">var<\/span> searchObject = {\n    <span style=\"color:#a50\">'user.consentGiven'<\/span>: <span style=\"color:#a50\">'false'<\/span>\n  };\n  \n  <span style=\"color:#aaa;font-style:italic\">\/\/ Change this if you have renamed the dataLayer array.\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">var<\/span> dataLayerName = <span style=\"color:#a50\">'dataLayer'<\/span>;\n  \n  <span style=\"color:#aaa;font-style:italic\">\/\/ Don't edit anything below this line.\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">var<\/span> getValueForObjectString = <span style=\"color:#00a\">function<\/span>(obj, key) {\n    <span style=\"color:#00a\">return<\/span> key.split(<span style=\"color:#a50\">\".\"<\/span>).reduce(<span style=\"color:#00a\">function<\/span>(o, x) {\n        <span style=\"color:#00a\">return<\/span> (<span style=\"color:#00a\">typeof<\/span> o == <span style=\"color:#a50\">\"undefined\"<\/span> || o === <span style=\"color:#00a\">null<\/span>) ? o : o[x];\n    }, obj);\n  };\n  \n  <span style=\"color:#00a\">return<\/span> <span style=\"color:#0aa\">window<\/span>[dataLayerName].filter(<span style=\"color:#00a\">function<\/span>(obj) {\n    <span style=\"color:#00a\">var<\/span> found = <span style=\"color:#00a\">false<\/span>;\n    <span style=\"color:#00a\">var<\/span> prop;\n    \n    <span style=\"color:#00a\">for<\/span> (prop <span style=\"color:#00a\">in<\/span> searchObject) {\n      <span style=\"color:#00a\">if<\/span> (obj[prop] == searchObject[prop] || getValueForObjectString(obj, prop) == searchObject[prop]) {\n        found = <span style=\"color:#00a\">true<\/span>;\n      }\n    }\n    <span style=\"color:#00a\">return<\/span> found;\n  }).length &gt; <span style=\"color:#099\">0<\/span>;\n}\n<\/code><\/pre>\n<\/div>\n<p>Here, you\u2019ll need to modify the <code>searchObject<\/code> by adding key-value pairs you want to search for in the <code>dataLayer<\/code> array.<\/p>\n<p>For example, if you wanted to find whether the <code>event<\/code> key has had the value <code>askForConsent<\/code> at some point, the object would look like this:<\/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:#00a\">var<\/span> searchObject = {\n  <span style=\"color:#a50\">'event'<\/span>: <span style=\"color:#a50\">'askForConsent'<\/span>\n};\n<\/code><\/pre>\n<\/div>\n<p>If you wanted to check whether that <code>event<\/code> value was pushed earlier OR whether the user has already given consent, you could do this:<\/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:#00a\">var<\/span> searchObject = {\n  <span style=\"color:#a50\">'event'<\/span>: <span style=\"color:#a50\">'askForConsent'<\/span>,\n  <span style=\"color:#a50\">'user.consentGiven'<\/span>: <span style=\"color:#00a\">true<\/span>\n};\n<\/code><\/pre>\n<\/div>\n<p>Note that if you use dot notation in the key name, the variable will <strong>first<\/strong> check whether a key with exactly that name (<code>user.consentGiven<\/code>) is found, after which it will check whether a nested structure like that (<code>{user: {consentGiven: true}}<\/code>) is found.<\/p>\n<p>Next, you\u2019ll need to modify the <code>dataLayerName<\/code> variable value in case you have renamed the <code>dataLayer<\/code> array to something else than the default.<\/p>\n<p>And then you\u2019re all set. The variable will return <code>true<\/code> in case any of the key-value pairs you specify in the <code>searchObject<\/code> is found in the <code>dataLayer<\/code> array.<\/p>\n<h2 id=\"caveats\">Caveats<\/h2>\n<p>There are <strong>two<\/strong> major caveats with this solution.<\/p>\n<h3 id=\"1-datalayer-is-unreliable\">1. <code>dataLayer<\/code> is unreliable<\/h3>\n<p>Nothing\u2019s stopping site code from deleting items from the <code>dataLayer<\/code>. In fact, if your array size <a href=\"https:\/\/www.simoahava.com\/analytics\/100-google-tag-manager-learnings\/#21-the-array-is-capped-at-300\">surpasses 300 members<\/a>, Google Tag Manager will automatically start removing items from the beginning.<\/p>\n<p>Similarly, if you\u2019re running a single-page app, it\u2019s possible the array is cleared between each page transition.<\/p>\n<p>In other words, there\u2019s no guarantee that this variable will find anything simply because the <code>dataLayer<\/code> array is not immutable nor is it supposed to be.<\/p>\n<h3 id=\"2-timing-matters\">2. Timing matters<\/h3>\n<p>Another important thing to note is that the <code>dataLayer<\/code> array is checked <strong>when the variable is run<\/strong>. This might lead to some unexpected results, especially if you\u2019re comparing the variable to what Preview mode is showing.<\/p>\n<p>When a tag fires with a trigger, Preview mode will show the state of Google Tag Manager\u2019s variables <strong>at the time the trigger event was pushed into <code>dataLayer<\/code><\/strong>. This might be a significant amount of time before the tag and its associated variables are actually executed.<\/p>\n<p>Thus, the state of the web page that the variable tries to access might differ from the state of the web page when the tag was actually triggered. This is mainly a problem if you try to consolidate what you try to look for with <code>searchObject<\/code> and what you try to access with Data Layer variables.<\/p>\n<p>For example, if the object with <code>user.consentGiven<\/code> is pushed a very short while after the event that triggered the tag (and the search variable), the tag will not be able to access this with a Data Layer variable, but the Custom JavaScript variable\u2019s <code>searchObject<\/code> will find the match in the <code>dataLayer<\/code> array.<\/p>\n<p>This is just something to pay attention to, especially if you\u2019re wondering why the variable claims something is found in <code>dataLayer<\/code> but the tag still can\u2019t access that particular value.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>Do you have ideas where this variable might be useful? I\u2019ve mainly come across two use cases:<\/p>\n<ol>\n<li>\n<p>On a single-page app, blocking the All Pages trigger from firing a Page View if there already is a \u201cvirtual pageview\u201d event in <code>dataLayer<\/code>.<\/p>\n<\/li>\n<li>\n<p>Checking for state transitions, such as whether a user used to be logged out, but is now logged in (compared to being logged in all the time).<\/p>\n<\/li>\n<\/ol>\n<p>What else?<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>One of the difficulties of working with Google Tag Manager and the dataLayer structure is that GTM doesn\u2019t preserve history of the items collected into its data model. Or, at least, it doesn\u2019t preserve it in a manner that would let us access it. This is typically a very niche problem, but it does surface [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":103109,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[38540,14492,47605,1715,5476],"dealstore":[],"offerexpiration":[],"class_list":["post-103108","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-datalayer","tag-gtmtips","tag-keyvalue","tag-pair","tag-search"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>#GTMTips: Search dataLayer For A Key-Value Pair - 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=103108\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"#GTMTips: Search dataLayer For A Key-Value Pair - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"One of the difficulties of working with Google Tag Manager and the dataLayer structure is that GTM doesn\u2019t preserve history of the items collected into its data model. Or, at least, it doesn\u2019t preserve it in a manner that would let us access it. This is typically a very niche problem, but it does surface [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=103108\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-22T09:29:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/search-datalayer-for-key-value-pair.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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=103108#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=103108\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"#GTMTips: Search dataLayer For A Key-Value Pair\",\"datePublished\":\"2025-02-22T09:29:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=103108\"},\"wordCount\":724,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=103108#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/search-datalayer-for-key-value-pair.jpg\",\"keywords\":[\"dataLayer\",\"GTMTips\",\"KeyValue\",\"Pair\",\"search\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=103108#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=103108\",\"url\":\"https:\/\/fivemor.com\/?p=103108\",\"name\":\"#GTMTips: Search dataLayer For A Key-Value Pair - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=103108#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=103108#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/search-datalayer-for-key-value-pair.jpg\",\"datePublished\":\"2025-02-22T09:29:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=103108#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=103108\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=103108#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/search-datalayer-for-key-value-pair.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/search-datalayer-for-key-value-pair.jpg\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=103108#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"#GTMTips: Search dataLayer For A Key-Value Pair\"}]},{\"@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: Search dataLayer For A Key-Value Pair - 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=103108","og_locale":"en_US","og_type":"article","og_title":"#GTMTips: Search dataLayer For A Key-Value Pair - Som2ny Network","og_description":"One of the difficulties of working with Google Tag Manager and the dataLayer structure is that GTM doesn\u2019t preserve history of the items collected into its data model. Or, at least, it doesn\u2019t preserve it in a manner that would let us access it. This is typically a very niche problem, but it does surface [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=103108","og_site_name":"Som2ny Network","article_published_time":"2025-02-22T09:29:44+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/search-datalayer-for-key-value-pair.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=103108#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=103108"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"#GTMTips: Search dataLayer For A Key-Value Pair","datePublished":"2025-02-22T09:29:44+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=103108"},"wordCount":724,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=103108#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/search-datalayer-for-key-value-pair.jpg","keywords":["dataLayer","GTMTips","KeyValue","Pair","search"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=103108#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=103108","url":"https:\/\/fivemor.com\/?p=103108","name":"#GTMTips: Search dataLayer For A Key-Value Pair - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=103108#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=103108#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/search-datalayer-for-key-value-pair.jpg","datePublished":"2025-02-22T09:29:44+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=103108#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=103108"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=103108#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/search-datalayer-for-key-value-pair.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/search-datalayer-for-key-value-pair.jpg","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=103108#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"#GTMTips: Search dataLayer For A Key-Value Pair"}]},{"@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\/103108","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=103108"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/103108\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/103109"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=103108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=103108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=103108"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=103108"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=103108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}