{"id":1306,"date":"2020-03-11T06:30:44","date_gmt":"2020-03-10T19:30:44","guid":{"rendered":"https:\/\/blog.datatrue.com\/?p=1306"},"modified":"2026-03-29T08:48:19","modified_gmt":"2026-03-29T08:48:19","slug":"automate-unit-testing-of-datalayer-triggeredtags","status":"publish","type":"post","link":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/","title":{"rendered":"How to automate unit testing of data layer triggered tags"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;4.16&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text admin_label=&#8221;Text&#8221; _builder_version=&#8221;4.17.3&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; sticky_enabled=&#8221;0&#8243;]<\/p>\n<p>There are a number of big <a href=\"https:\/\/www.blastanalytics.com\/blog\/why-you-need-data-layer-web-analytics-implementation\">advantages<\/a> to implementing a data layer, including better data consistency, improved reliability, and increased flexibility when it comes to sending data to different analytics vendors. However, there is one <a href=\"https:\/\/blog.datatrue.com\/automated-data-layer-testing\/\">downside<\/a> \u2014 a data layer is yet another possible failure point in your analytics pipeline, which means that you need to test regularly to ensure that it\u2019s collecting and sending complete, accurate data.<\/p>\n<\/p>\n<p>In a <a href=\"https:\/\/blog.datatrue.com\/automated-data-layer-testing\/\">previous blog post<\/a>, we talked about how to validate the data that\u2019s passed to your tag manager from your data layer. But what about verifying that the data layer is firing the correct tags in response to user actions? For example, if a customer adds an item to their cart, you want your data layer to record that event (along with relevant details such as the item name, price, quantity, etc.) and fire a tag to pass the new information to your analytics tools. If the tag doesn\u2019t fire, or fires incorrectly, you could be missing critical data.<\/p>\n<\/p>\n<p>You may be able to trigger certain data layer updates by visiting your site and manually stepping through the relevant actions, or (more efficiently) by running a Simulation Test, but there are some scenarios that are difficult or impossible to test directly. These include:<\/p>\n<\/p>\n<ul>\n<li>Edge cases (e.g., out-of-stock products, missing or misformatted product data),<\/li>\n<li>Updates that occur in controlled areas or pages (e.g., order confirmation), or<\/li>\n<li>Updates resulting from workflows that aren\u2019t yet built or stable in production.<\/li>\n<\/ul>\n<\/p>\n<p>For these cases, you need a way to force the data layer to update so you can verify that the correct tags fire in response. The best way to do this is by including a \u201cRun Script\u201d step in your Simulation Test. In the \u201cadd to cart\u201d scenario, for example, your script might look like this:<\/p>\n<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s\" alt=\"\" \/><\/figure>\n<\/p>\n<p>When the Simulation Test runs, this script will update the data layer with the \u201caddToCart\u201d event and item data \u2014 regardless of whether the event was actually completed on the page.<\/p>\n<\/p>\n<p>From there, you can add a Tag Validation to the Run Script step to check that the expected tag fires when the data layer updates:<\/p>\n<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/Y-48yZWqeYL_xQ85Ku5eMKoMpQYp5im46LFBciMgkJXbjkru0vSOWhr9lNdR_axcarPeh5bbL8Wku2bw6d0_mruHMEaGWdLM8fAzpepniNzbNCobMFEkQdR9lAcabY8LwYp3nSOO\" alt=\"\" \/><\/figure>\n<\/p>\n<p>You can add as many Run Script steps as you need to test variations of the data layer event (e.g., adding multiple products to the cart) or to test related events (e.g., removing an item from the cart). And, of course, you can use similar test configurations to test edge cases and actions that can\u2019t be easily completed on your live site.<\/p>\n<\/p>\n<p>For more information about testing data layer triggered tags, including step-by-step instructions, <a href=\"https:\/\/support.datatrue.com\/hc\/en-us\/articles\/360035034531-How-to-automate-testing-of-data-layer-triggered-tags\">check out this article<\/a> in the DataTrue help center.<\/p>\n<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;4.16&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text admin_label=&#8221;Text&#8221; _builder_version=&#8221;4.17.3&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; sticky_enabled=&#8221;0&#8243;] There are a number of big advantages to implementing a data layer, including better data consistency, improved reliability, and increased flexibility when it comes to sending data to different analytics vendors. [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"\n\t\t\t\t<!-- wp:paragraph -->\n<p>There are a number of big <a href=\"https:\/\/www.blastanalytics.com\/blog\/why-you-need-data-layer-web-analytics-implementation\">advantages<\/a> to implementing a data layer, including better data consistency, improved reliability, and increased flexibility when it comes to sending data to different analytics vendors. However, there is one <a href=\"https:\/\/blog.datatrue.com\/automated-data-layer-testing\/\">downside<\/a> \u2014 a data layer is yet another possible failure point in your analytics pipeline, which means that you need to test regularly to ensure that it\u2019s collecting and sending complete, accurate data.&nbsp;<br><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>In a <a href=\"https:\/\/blog.datatrue.com\/automated-data-layer-testing\/\">previous blog post<\/a>, we talked about how to validate the data that\u2019s passed to your tag manager from your data layer. But what about verifying that the data layer is firing the correct tags in response to user actions? For example, if a customer adds an item to their cart, you want your data layer to record that event (along with relevant details such as the item name, price, quantity, etc.) and fire a tag to pass the new information to your analytics tools. If the tag doesn\u2019t fire, or fires incorrectly, you could be missing critical data.&nbsp;<br><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>You may be able to trigger certain data layer updates by visiting your site and manually stepping through the relevant actions, or (more efficiently) by running a <a href=\"https:\/\/support.datatrue.com\/hc\/en-us\/sections\/360001396031-Monitor-critical-workflows-with-a-Simulation-Test\">Simulation Test<\/a>, but there are some scenarios that are difficult or impossible to test directly. These include:&nbsp;<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:list -->\n<ul><li>Edge cases (e.g., out-of-stock products, missing or misformatted product data),&nbsp;<\/li><li>Updates that occur in controlled areas or pages (e.g., order confirmation), or&nbsp;<\/li><li>Updates resulting from workflows that aren\u2019t yet built or stable in production.&nbsp;<\/li><\/ul>\n<!-- \/wp:list -->\n\n<!-- wp:paragraph -->\n<p>For these cases, you need a way to force the data layer to update so you can verify that the correct tags fire in response. The best way to do this is by including a \u201cRun Script\u201d step in your Simulation Test. In the \u201cadd to cart\u201d scenario, for example, your script might look like this:<br><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:image -->\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s\" alt=\"\"\/><\/figure>\n<!-- \/wp:image -->\n\n<!-- wp:paragraph -->\n<p>When the Simulation Test runs, this script will update the data layer with the \u201caddToCart\u201d event and item data \u2014 regardless of whether the event was actually completed on the page.&nbsp;<br><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>From there, you can add a Tag Validation to the Run Script step to check that the expected tag fires when the data layer updates:<br><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:image -->\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/Y-48yZWqeYL_xQ85Ku5eMKoMpQYp5im46LFBciMgkJXbjkru0vSOWhr9lNdR_axcarPeh5bbL8Wku2bw6d0_mruHMEaGWdLM8fAzpepniNzbNCobMFEkQdR9lAcabY8LwYp3nSOO\" alt=\"\"\/><\/figure>\n<!-- \/wp:image -->\n\n<!-- wp:paragraph -->\n<p>You can add as many Run Script steps as you need to test variations of the data layer event (e.g., adding multiple products to the cart) or to test related events (e.g., removing an item from the cart). And, of course, you can use similar test configurations to test edge cases and actions that can\u2019t be easily completed on your live site.&nbsp;<br><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>For more information about testing data layer triggered tags, including step-by-step instructions, <a href=\"https:\/\/support.datatrue.com\/hc\/en-us\/articles\/360035034531-How-to-automate-testing-of-data-layer-triggered-tags\">check out this article<\/a> in the DataTrue help center.&nbsp;<br><\/p>\n<!-- \/wp:paragraph -->\t\t","_et_gb_content_width":"","footnotes":""},"categories":[24],"tags":[],"class_list":["post-1306","post","type-post","status-publish","format-standard","hentry","category-guide"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to automate unit testing of data layer triggered tags - DataTrue<\/title>\n<meta name=\"description\" content=\"Validate data collected by Analytics Tracking Tags in Websites &amp; Mobile apps. Enterprise-grade quality assurance for Reporting, Consent &amp; Privacy Compliance and Agile Development cycles.\" \/>\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\/automate-unit-testing-of-datalayer-triggeredtags\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to automate unit testing of data layer triggered tags - DataTrue\" \/>\n<meta property=\"og:description\" content=\"Validate data collected by Analytics Tracking Tags in Websites &amp; Mobile apps. Enterprise-grade quality assurance for Reporting, Consent &amp; Privacy Compliance and Agile Development cycles.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/\" \/>\n<meta property=\"og:site_name\" content=\"DataTrue\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/datatruedigital\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-10T19:30:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-29T08:48:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lh6.googleusercontent.com\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s\" \/>\n<meta name=\"author\" content=\"DataTrue Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@data_true\" \/>\n<meta name=\"twitter:site\" content=\"@data_true\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataTrue Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/\"},\"author\":{\"name\":\"DataTrue Team\",\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/#\\\/schema\\\/person\\\/43e68c18f7eb83e8a1109f2e5ed97123\"},\"headline\":\"How to automate unit testing of data layer triggered tags\",\"datePublished\":\"2020-03-10T19:30:44+00:00\",\"dateModified\":\"2026-03-29T08:48:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/\"},\"wordCount\":543,\"publisher\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/lh6.googleusercontent.com\\\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s\",\"articleSection\":[\"Guide\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/\",\"url\":\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/\",\"name\":\"How to automate unit testing of data layer triggered tags - DataTrue\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/lh6.googleusercontent.com\\\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s\",\"datePublished\":\"2020-03-10T19:30:44+00:00\",\"dateModified\":\"2026-03-29T08:48:19+00:00\",\"description\":\"Validate data collected by Analytics Tracking Tags in Websites & Mobile apps. Enterprise-grade quality assurance for Reporting, Consent & Privacy Compliance and Agile Development cycles.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/#primaryimage\",\"url\":\"https:\\\/\\\/lh6.googleusercontent.com\\\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s\",\"contentUrl\":\"https:\\\/\\\/lh6.googleusercontent.com\\\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/automate-unit-testing-of-datalayer-triggeredtags\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/datatrue.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to automate unit testing of data layer triggered tags\"}]},{\"@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\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/datatrue.com\\\/en\\\/#\\\/schema\\\/person\\\/43e68c18f7eb83e8a1109f2e5ed97123\",\"name\":\"DataTrue Team\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to automate unit testing of data layer triggered tags - DataTrue","description":"Validate data collected by Analytics Tracking Tags in Websites & Mobile apps. Enterprise-grade quality assurance for Reporting, Consent & Privacy Compliance and Agile Development cycles.","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\/automate-unit-testing-of-datalayer-triggeredtags\/","og_locale":"en_US","og_type":"article","og_title":"How to automate unit testing of data layer triggered tags - DataTrue","og_description":"Validate data collected by Analytics Tracking Tags in Websites & Mobile apps. Enterprise-grade quality assurance for Reporting, Consent & Privacy Compliance and Agile Development cycles.","og_url":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/","og_site_name":"DataTrue","article_publisher":"https:\/\/www.facebook.com\/datatruedigital\/","article_published_time":"2020-03-10T19:30:44+00:00","article_modified_time":"2026-03-29T08:48:19+00:00","og_image":[{"url":"https:\/\/lh6.googleusercontent.com\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s","type":"","width":"","height":""}],"author":"DataTrue Team","twitter_card":"summary_large_image","twitter_creator":"@data_true","twitter_site":"@data_true","twitter_misc":{"Written by":"DataTrue Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/#article","isPartOf":{"@id":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/"},"author":{"name":"DataTrue Team","@id":"https:\/\/datatrue.com\/en\/#\/schema\/person\/43e68c18f7eb83e8a1109f2e5ed97123"},"headline":"How to automate unit testing of data layer triggered tags","datePublished":"2020-03-10T19:30:44+00:00","dateModified":"2026-03-29T08:48:19+00:00","mainEntityOfPage":{"@id":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/"},"wordCount":543,"publisher":{"@id":"https:\/\/datatrue.com\/en\/#organization"},"image":{"@id":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/#primaryimage"},"thumbnailUrl":"https:\/\/lh6.googleusercontent.com\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s","articleSection":["Guide"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/","url":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/","name":"How to automate unit testing of data layer triggered tags - DataTrue","isPartOf":{"@id":"https:\/\/datatrue.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/#primaryimage"},"image":{"@id":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/#primaryimage"},"thumbnailUrl":"https:\/\/lh6.googleusercontent.com\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s","datePublished":"2020-03-10T19:30:44+00:00","dateModified":"2026-03-29T08:48:19+00:00","description":"Validate data collected by Analytics Tracking Tags in Websites & Mobile apps. Enterprise-grade quality assurance for Reporting, Consent & Privacy Compliance and Agile Development cycles.","breadcrumb":{"@id":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/#primaryimage","url":"https:\/\/lh6.googleusercontent.com\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s","contentUrl":"https:\/\/lh6.googleusercontent.com\/gMI3CNAM4-CNmyjg0-lY5fkEMmRmB-sVz5lifTk8QhnIo-r_uLWfK2BnP9tmG4f9czdQTgYX1oAxVEkB9HaT528OjACu8_rcz1_Blm-AnPFmqVfoIl1LiQqpK13Ki64xGvitoa-s"},{"@type":"BreadcrumbList","@id":"https:\/\/datatrue.com\/en\/automate-unit-testing-of-datalayer-triggeredtags\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/datatrue.com\/en\/"},{"@type":"ListItem","position":2,"name":"How to automate unit testing of data layer triggered tags"}]},{"@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"]},{"@type":"Person","@id":"https:\/\/datatrue.com\/en\/#\/schema\/person\/43e68c18f7eb83e8a1109f2e5ed97123","name":"DataTrue Team"}]}},"_links":{"self":[{"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/posts\/1306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/types\/post"}],"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=1306"}],"version-history":[{"count":0,"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/posts\/1306\/revisions"}],"wp:attachment":[{"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/media?parent=1306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/categories?post=1306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datatrue.com\/en\/wp-json\/wp\/v2\/tags?post=1306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}