{"id":122655,"date":"2025-03-09T18:41:52","date_gmt":"2025-03-09T18:41:52","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/google-tag-manager-api-v2-released\/"},"modified":"2025-03-09T18:41:52","modified_gmt":"2025-03-09T18:41:52","slug":"google-tag-manager-api-v2-released","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=122655","title":{"rendered":"Google Tag Manager API V2 Released"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p><a href=\"https:\/\/tagmanager.google.com\/\">Google Tag Manager<\/a> has a very nifty <a href=\"http:\/\/online-behavior.com\/analytics\/tag-manager-api\">programmatic API<\/a> that lets you do almost anything that\u2019s also possible within the GTM UI. I\u2019ve used the API a lot, most notably for my <a href=\"http:\/\/www.gtmtools.com\/\">GTM Tools<\/a>, which might be getting a new release soon, too!<\/p>\n<p>The API was recently updated to its <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/\">second release version<\/a> (V2), and in this article I want to go over the additions, removals, and changes that the new version introduced.<\/p>\n<div style=\"aspect-ratio: 2834 \/ 916;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2017\/03\/gtm-api-v2.jpg\" title=\"Google Tag Manager API V2\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"916\" width=\"2834\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2017\/03\/gtm-api-v2.jpg#ZgotmplZ\" alt=\"Google Tag Manager API V2\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>First of all, <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v1\/\">V1 of the API<\/a> is still fully functional, so you don\u2019t have to migrate until you\u2019re ready. That being said, the new version brings about a number of changes I\u2019m sure you\u2019ll find helpful when working with the API.<\/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=\"biggest-changes\">Biggest changes<\/h2>\n<p>The most significant change, in my opinion, is the introduction of <a href=\"https:\/\/www.simoahava.com\/analytics\/google-tag-manager-workspaces\/\"><strong>workspace<\/strong><\/a> as the central focus in almost all interactions with anything on the container level. It\u2019s not just that there\u2019s a new namespace for workspaces in the API, but that you must always reference a workspace when interacting with container assets. This is going to be the biggest hurdle in a migration, I believe. Anything that happens in a workspace (pretty much all UI interactions with a single container draft) must now be accompanied by the workspace ID of the workspace you want to modify. This, in turn, means a round trip via the <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\">workspaces API<\/a> to get the IDs you need.<\/p>\n<div style=\"aspect-ratio: 1748 \/ 920;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2017\/03\/gtm-api-workspaces.jpg\" title=\"Workspaces in the GTM API\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"920\" width=\"1748\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2017\/03\/gtm-api-workspaces.jpg#ZgotmplZ\" alt=\"Workspaces in the GTM API\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Another very visible change is the separation of <strong>Built-in Variables<\/strong> into its own <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\/built_in_variables\">namespace<\/a>. Luckily there\u2019s also a simple batching shorthand for enabling \/ deleting multiple Built-in Variables in a single request.<\/p>\n<p>On a technical level, when using client libraries you now provide the path to the asset as a single parameter (basically <code>path<\/code> or <code>parent<\/code>) instead of using multiple named parameters. The new resource representations include the <code>path<\/code> key, which you can then use to easily chain API commands together.<\/p>\n<p>Finally, and I love this, there\u2019s support for adding <strong>notes<\/strong> to pretty much any resource available via the API. Even though the UI doesn\u2019t yet support the <strong>notes<\/strong> field as widely, you can now add descriptive text to all assets via the API. Very useful for documenting the container.<\/p>\n<p>(<strong>UPDATE<\/strong>: a short while after writing this article, GTM released <a href=\"https:\/\/twitter.com\/SimoAhava\/status\/848049430184030208\">support for notes in the UI<\/a> too, yay!)<\/p>\n<h2 id=\"detailed-changes\">Detailed changes<\/h2>\n<p>What follows is a walkthrough of all the namespaces in the new version of the API, with information on what changed from V1.<\/p>\n<h3 id=\"1-accounts\">1. Accounts<\/h3>\n<p><strong>Resource changes:<\/strong> The <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\">Accounts resource<\/a> has the following <strong>new<\/strong> fields:<\/p>\n<ul>\n<li><code>path<\/code>: path of the Account, e.g. <code>accounts\/12345<\/code><\/li>\n<li><code>tagManagerUrl<\/code>: direct URL to your account in the GTM API<\/li>\n<\/ul>\n<p><strong>Method changes:<\/strong> There are no significant changes in Accounts methods.<\/p>\n<h3 id=\"2-built-in-variables\">2. Built-in Variables<\/h3>\n<p>This is a completely new namespace in the API. Instead of passing a list of Built-in Variables in the container resource itself, you now need to explicitly enable Built-in Variables in the workspace of your choice. You can read the full description of this new feature <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\/built_in_variables\">here<\/a>.<\/p>\n<p>Note that if you want to enable multiple Built-in Variables in a single request (strongly recommended), you can use a shorthand batch format to do so.<\/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-python\" data-lang=\"python\">accounts()\n    .containers()\n    .workspaces()\n    .built_in_variables()\n    .create(\n        parent=<span style=\"color:#a50\">'accounts\/<\/span><span style=\"color:#a50\">%s<\/span><span style=\"color:#a50\">\/containers\/<\/span><span style=\"color:#a50\">%s<\/span><span style=\"color:#a50\">\/workspaces\/<\/span><span style=\"color:#a50\">%s<\/span><span style=\"color:#a50\">'<\/span> % (accountId, containerId, workspaceId),\n        <span style=\"color:#0aa\">type<\/span>=[<span style=\"color:#a50\">'clickClasses'<\/span>, <span style=\"color:#a50\">'clickElement'<\/span>, <span style=\"color:#a50\">'clickId'<\/span>, <span style=\"color:#a50\">'clickUrl'<\/span>, <span style=\"color:#a50\">'clickText'<\/span>, <span style=\"color:#a50\">'clickTarget'<\/span>] )<\/code><\/pre>\n<\/div>\n<h3 id=\"3-containers\">3. Containers<\/h3>\n<p><strong>Resource changes:<\/strong> The <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\">Containers<\/a> namespace hasn\u2019t changed that much. The <strong>new<\/strong> fields are the same as with Accounts: <code>path<\/code> and <code>tagManagerUrl<\/code>. Fields that were <strong>removed<\/strong> from V2 are the redundant <code>timeZoneCountryId<\/code> and <code>timeZoneId<\/code>. The <code>enabledBuiltInVariable<\/code> field has been replaced by the Built-in Variables namespace introduced above.<\/p>\n<p><strong>Method changes:<\/strong> There are no significant changes to the Containers methods.<\/p>\n<h3 id=\"4-environments\">4. Environments<\/h3>\n<p><strong>Resource changes:<\/strong> The main changes to the <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/environments\">Environments<\/a> resource are the following:<\/p>\n<ul>\n<li>\n<p><code>path<\/code>: relative path in the API to the given environment<\/p>\n<\/li>\n<li>\n<p><code>authorizationTimestamp<\/code>: supports both <code>nanos<\/code> and <code>seconds<\/code> as values<\/p>\n<\/li>\n<li>\n<p><code>workspaceId<\/code>: link to preview a given workspace in the environment<\/p>\n<\/li>\n<li>\n<p><code>tagManagerUrl<\/code>: link to the Environments page in the container<\/p>\n<\/li>\n<\/ul>\n<p><strong>Method changes<\/strong>: The most significant change is that the old <code>environments.reauthorize_environments<\/code> namespace has been removed in favor of simply adding a <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/environments\/reauthorize\"><code>reauthorize()<\/code><\/a> method to the main Environments API.<\/p>\n<h3 id=\"5-folders\">5. Folders<\/h3>\n<p><strong>Resource changes:<\/strong> The big changes to the <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\/folders\">Folders<\/a> resource are:<\/p>\n<ul>\n<li>\n<p><code>path<\/code>: relative API path to the folder<\/p>\n<\/li>\n<li>\n<p><code>workspaceId<\/code>: ID of the workspace from which the folder was fetched<\/p>\n<\/li>\n<li>\n<p><code>tagManagerUrl<\/code>: link to the folder in the GTM UI<\/p>\n<\/li>\n<li>\n<p><code>notes<\/code>: notes about the folder<\/p>\n<\/li>\n<\/ul>\n<p><strong>Method changes:<\/strong> The main changes to the methods are that both <code>folders.entities<\/code> and <code>folders.move_folders<\/code> have been replaced with their own dedicated API methods in <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\/folders\/entities\"><code>entities()<\/code><\/a> and <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\/folders\/move_entities_to_folder\"><code>move_entities_to_folders()<\/code><\/a>, respectively.<\/p>\n<p>There\u2019s also a new method, <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\/folders\/revert\"><code>revert()<\/code><\/a>, which lets you revert changes to a folder in the given workspace.<\/p>\n<h3 id=\"6-tags\">6. Tags<\/h3>\n<p><strong>Resource changes:<\/strong> The only changes are the inclusion of <code>path<\/code>, <code>workspaceId<\/code> and <code>tagManagerUrl<\/code>. Otherwise the resource representation has remained relatively unchanged.<\/p>\n<p><strong>Method changes:<\/strong> The only big change is the introduction of the <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\/tags\/revert\"><code>revert()<\/code><\/a> method, which lets you cancel any changes to the tag in the given workspace.<\/p>\n<h3 id=\"7-triggers\">7. Triggers<\/h3>\n<p>Triggers was affected in exactly the same way as Tags. The changes are identical, with the exception of <code>notes<\/code> now introduced as a writable field for Triggers, too.<\/p>\n<h3 id=\"8-user-permissions\">8. User Permissions<\/h3>\n<p>(Note, this used to be called just <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v1\/reference\/accounts\/permissions\">Permissions<\/a> in the previous API version documentation.)<br \/>\n<strong>Resource changes:<\/strong> The main changes to <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/user_permissions\">User Permissions<\/a> are:<\/p>\n<ul>\n<li>\n<p><code>path<\/code>: relative API path to the permission entity, includes the <code>permissionId<\/code><\/p>\n<\/li>\n<li>\n<p><code>accountAccess.permission<\/code>: now a string rather than a list\/array<\/p>\n<\/li>\n<li>\n<p><code>containerAccess[].permission<\/code>: now a string rather than a list\/array<\/p>\n<\/li>\n<\/ul>\n<p><strong>Method changes:<\/strong> No significant changes to methods.<\/p>\n<h3 id=\"8-variables\">8. Variables<\/h3>\n<p>Changes to <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\/variables\">Variables<\/a> are pretty much on par with what\u2019s done to Tags, so check the relevant section above for more details.<\/p>\n<p>The <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/version_headers\">Version Headers<\/a> API is a new addition to the GTM API. Basically, it\u2019s a shorthand for accessing versions of any given container. Unlike the Versions API itself, Version Headers only returns, surprise surprise, headers. This keeps the API calls really lean, and lets you quickly get the necessary information, such as the version ID.<\/p>\n<p>You can check the documentation for more details on the <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/version_headers\/latest\">resource representation<\/a>.<\/p>\n<p>The API has two methods.<\/p>\n<ul>\n<li>\n<p><code>latest()<\/code> returns the version header of the Latest Container Version. The Latest version is the most recently created version in Google Tag Manager, and is very relevant to Workspaces, since Workspaces need to be synchronized with the Latest container version before they can be published or turned into versions themselves.<\/p>\n<\/li>\n<li>\n<p><code>list()<\/code> returns a list of all container versions in any given container.<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"10-versions\">10. Versions<\/h3>\n<p>(Note, this used to be called <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v1\/reference\/accounts\/containers\/versions\">Container Versions<\/a> in the previous API version documentation.)<br \/>\n<strong>Resource changes:<\/strong> Here are the changes to <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/versions\">Versions<\/a> in the GTM API:<\/p>\n<ul>\n<li>\n<p><code>path<\/code>: relative API path to the container version<\/p>\n<\/li>\n<li>\n<p><code>description<\/code>: used to be called <code>notes<\/code> in the previous API version<\/p>\n<\/li>\n<li>\n<p><code>builtInVariable<\/code>: list of Built-in Variables enabled in the version<\/p>\n<\/li>\n<li>\n<p><code>tagManagerUrl<\/code>: link to the container version in the GTM UI<\/p>\n<\/li>\n<\/ul>\n<p>Note that the <code>macro<\/code> and <code>rule<\/code> parameters have been deprecated in the new API version.<\/p>\n<p><strong>Method changes<\/strong>: Here are the main changes to Versions methods:<\/p>\n<ul>\n<li>\n<p><code>create()<\/code>: <strong>deprecated<\/strong> &#8211; container version creation is done via Workspaces<\/p>\n<\/li>\n<li>\n<p><code>list()<\/code>: <strong>deprecated<\/strong> &#8211; version list is now done via Version Headers<\/p>\n<\/li>\n<li>\n<p><code>live()<\/code>: retrieves the container version that is currently live in the container<\/p>\n<\/li>\n<li>\n<p><code>set_latest()<\/code>: sets the given version as the Latest version in the container &#8211; replaces <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v1\/reference\/accounts\/containers\/versions\/restore\"><code>restore()<\/code><\/a> in the previous API version<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"11-workspaces\">11. Workspaces<\/h3>\n<p>The <strong>Workspaces API<\/strong> was introduced in V2 of the GTM API. You will definitely want to follow <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\">this link<\/a> and familiarize yourself with the new API. Understanding how <a href=\"https:\/\/www.simoahava.com\/analytics\/google-tag-manager-workspaces\/\">workspaces function in the container<\/a> is integral to understanding how the GTM API works.<\/p>\n<ul>\n<li>\n<p><code>create_version()<\/code> creates a version out of a workspace but only if the version passes all GTM\u2019s syntax and validation checks.<\/p>\n<\/li>\n<li>\n<p><code>getStatus()<\/code> returns all the conflicting and\/or modified entities in the workspace. This is useful if you want to check if the workspace is ready to be turned into a version.<\/p>\n<\/li>\n<li>\n<p><code>resolve_conflict()<\/code> lets you resolve conflicts in favor of the workspace or the latest version.<\/p>\n<\/li>\n<li>\n<p><code>sync()<\/code> lets you synchronize the workspace with the latest container version &#8211; a necessary step to take before creating the version.<\/p>\n<\/li>\n<\/ul>\n<p>Workspaces are fundamental to many interactions with the API. Basically, when you work with tags, triggers, variables, folders, and built-in variables, you always need to provide the workspace ID with which you are interacting. There\u2019s no single \u201cContainer draft\u201d anymore. There\u2019s always a workspace you\u2019re working in.<\/p>\n<p>In addition to having to update your methods, this also means that you need to rethink some of the API flows you have been using thus far. For example, instead of just creating new items in a container, you now need to specify the workspace you want to work with. This means you might first need to <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\/list\"><code>list()<\/code><\/a> the available workspaces to get the ID you are looking for. Or perhaps you want to <a href=\"https:\/\/developers.google.com\/tag-manager\/api\/v2\/reference\/accounts\/containers\/workspaces\/create\"><code>create()<\/code><\/a> a new workspace so that you don\u2019t mess with other people\u2019s unfinished work.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>The new API certainly has a lot of stuff to wrap your head around. The introduction of workspaces, for one, is certain to make migration a bit of a headache. However, it would be equally awkward to work with an API that isn\u2019t in sync with the feature set of the UI it is managing. For this reason, I think it makes a lot of sense to upgrade to the latest API version as soon as possible.<\/p>\n<p>Most of the stuff is easy to figure out, such as how to move from <code>accountId=<\/code> and <code>containerId=<\/code> to <code>path=accounts\/accountId\/containers\/containerId<\/code>. In fact, I think changes like this make it easier to work with programming languages that make use of string interpolation (Python, for example). There are some conventions that might take time to understand routinely, such as how to use <code>versionheaders.list<\/code> instead of <code>versions.list<\/code>.<\/p>\n<p>One thing that\u2019s a constant feature request from me is that Google would update their error messages. It\u2019s very difficult to understand what\u2019s wrong when all you see in the logs is \u201c400 Bad Request\u201d or \u201c500 Backend Error\u201d.<\/p>\n<p>What do you think about the new API? Have you written tools for the GTM API you want to share? Please do!<\/p>\n<\/p><\/div>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><br \/>\n<br \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google Tag Manager has a very nifty programmatic API that lets you do almost anything that\u2019s also possible within the GTM UI. I\u2019ve used the API a lot, most notably for my GTM Tools, which might be getting a new release soon, too! The API was recently updated to its second release version (V2), and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":122656,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[13966,1531,14495,20721,1791],"dealstore":[],"offerexpiration":[],"class_list":["post-122655","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-api","tag-google","tag-manager","tag-released","tag-tag"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Google Tag Manager API V2 Released - 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=122655\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Tag Manager API V2 Released - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"Google Tag Manager has a very nifty programmatic API that lets you do almost anything that\u2019s also possible within the GTM UI. I\u2019ve used the API a lot, most notably for my GTM Tools, which might be getting a new release soon, too! The API was recently updated to its second release version (V2), and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=122655\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-09T18:41:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/gtm-api-v2-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"827\" \/>\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=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=122655#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=122655\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Google Tag Manager API V2 Released\",\"datePublished\":\"2025-03-09T18:41:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=122655\"},\"wordCount\":1638,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=122655#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/gtm-api-v2-scaled.jpg\",\"keywords\":[\"API\",\"Google\",\"Manager\",\"Released\",\"TAG\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=122655#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=122655\",\"url\":\"https:\/\/fivemor.com\/?p=122655\",\"name\":\"Google Tag Manager API V2 Released - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=122655#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=122655#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/gtm-api-v2-scaled.jpg\",\"datePublished\":\"2025-03-09T18:41:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=122655#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=122655\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=122655#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/gtm-api-v2-scaled.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/gtm-api-v2-scaled.jpg\",\"width\":2560,\"height\":827},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=122655#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Google Tag Manager API V2 Released\"}]},{\"@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":"Google Tag Manager API V2 Released - 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=122655","og_locale":"en_US","og_type":"article","og_title":"Google Tag Manager API V2 Released - Som2ny Network","og_description":"Google Tag Manager has a very nifty programmatic API that lets you do almost anything that\u2019s also possible within the GTM UI. I\u2019ve used the API a lot, most notably for my GTM Tools, which might be getting a new release soon, too! The API was recently updated to its second release version (V2), and [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=122655","og_site_name":"Som2ny Network","article_published_time":"2025-03-09T18:41:52+00:00","og_image":[{"width":2560,"height":827,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/gtm-api-v2-scaled.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=122655#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=122655"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Google Tag Manager API V2 Released","datePublished":"2025-03-09T18:41:52+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=122655"},"wordCount":1638,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=122655#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/gtm-api-v2-scaled.jpg","keywords":["API","Google","Manager","Released","TAG"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=122655#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=122655","url":"https:\/\/fivemor.com\/?p=122655","name":"Google Tag Manager API V2 Released - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=122655#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=122655#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/gtm-api-v2-scaled.jpg","datePublished":"2025-03-09T18:41:52+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=122655#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=122655"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=122655#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/gtm-api-v2-scaled.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/gtm-api-v2-scaled.jpg","width":2560,"height":827},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=122655#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Google Tag Manager API V2 Released"}]},{"@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\/122655","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=122655"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/122655\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/122656"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=122655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=122655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=122655"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=122655"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=122655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}