{"id":104021,"date":"2025-02-22T20:37:18","date_gmt":"2025-02-22T20:37:18","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/tracking-cross-domain-iframes-upgraded-solution\/"},"modified":"2025-02-22T20:37:18","modified_gmt":"2025-02-22T20:37:18","slug":"tracking-cross-domain-iframes-upgraded-solution","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=104021","title":{"rendered":"Tracking Cross-domain Iframes &#8211; Upgraded Solution"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<blockquote>\n<p>**Last updated <strong>18 September 2020<\/strong>: Due to how <a href=\"https:\/\/www.cookiestatus.com\/\">most browsers now have third-party cookie protections<\/a> in place, this solution will be very ineffective going forwards. You should instead take a look at a <a href=\"https:\/\/www.simoahava.com\/analytics\/cookieless-tracking-cross-site-iframes\/\">cookieless solution<\/a>.<\/p>\n<\/blockquote>\n<p>Some years ago, I wrote a post on <a href=\"https:\/\/www.simoahava.com\/analytics\/iframe-cross-domain-tracking-in-google-tag-manager\/\">how to track cross-domain iframes<\/a> when using <a href=\"https:\/\/tagmanager.google.com\">Google Tag Manager<\/a> and <a href=\"https:\/\/analytics.google.com\">Google Analytics<\/a>. That solution relied on <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/hitcallback-eventcallback\/\"><code>hitCallback<\/code><\/a> to decorate the iframe, and now that I look back on it, it has its shortcomings.<\/p>\n<p>For one, the older solution used <code>hitCallback<\/code> which, while being reliable in that Google Analytics has definitely loaded with the linker plugin when the method is called, doesn\u2019t take into account the possible race condition of the script running before the iframe has been loaded.<\/p>\n<p>An additional problem was that the older solution simply grabbed the linker from the first Google Analytics tracker object on the page. But this might not be the one we want to use for the cross-domain tracking.<\/p>\n<div style=\"aspect-ratio: 1756 \/ 918;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/iframe-cross-domain.jpg\" title=\"Iframe Cross Domain\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"918\" width=\"1756\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/iframe-cross-domain.jpg#ZgotmplZ\" alt=\"Iframe Cross Domain\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>In this solution, we\u2019ll use the wonderful <a href=\"https:\/\/www.simoahava.com\/analytics\/customtask-the-guide\/\"><code>customTask<\/code><\/a> to decorate the target iframe. The <code>customTask<\/code> leverages a <code>setInterval()<\/code> script which polls the page periodically until the target iframe is found or a timeout is reached.<\/p>\n<div style=\"aspect-ratio: 2082 \/ 1770;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/customtask-builder-iframe-decorator.jpg\" title=\"customTask Builder - iframe decorator\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1770\" width=\"2082\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/customtask-builder-iframe-decorator.jpg#ZgotmplZ\" alt=\"customTask Builder - iframe decorator\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Naturally, this script has been added to my <a href=\"https:\/\/www.simoahava.com\/tools\/customtask-builder\/\">customTask Builder tool<\/a>.<\/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=\"the-customtask-itself\">The customTask itself<\/h2>\n<p>This is what the <code>customTask<\/code> looks like. To deploy it, make sure you read the instructions in the <a href=\"https:\/\/www.simoahava.com\/tools\/customtask-builder\/\">customTask Builder tool<\/a> before copy-pasting the required code into your page JavaScript (if using the <a href=\"https:\/\/www.simoahava.com\/tools\/customtask-builder\/#deployment-with-analytics-js\">Universal Analytics on-page snippet<\/a>) or a Custom JavaScript variable (if using <a href=\"https:\/\/www.simoahava.com\/tools\/customtask-builder\/#deployment-with-google-tag-manager\">Google Tag Manager<\/a>).<\/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:#00a\">var<\/span> iframeDecorator = {\n    selector: <span style=\"color:#a50\">'iframe#decorateMe'<\/span>,\n    attempts: <span style=\"color:#099\">10<\/span>,\n    intervalMs: <span style=\"color:#099\">1000<\/span>,\n    useAnchor: <span style=\"color:#00a\">false<\/span>\n  };\n\n  <span style=\"color:#aaa;font-style:italic\">\/\/ DO NOT EDIT ANYTHING BELOW THIS LINE\n<\/span><span style=\"color:#aaa;font-style:italic\"\/>  <span style=\"color:#00a\">var<\/span> globalSendHitTaskName   = <span style=\"color:#a50\">'_ga_originalSendHitTask'<\/span>;\n\n  <span style=\"color:#00a\">return<\/span> <span style=\"color:#00a\">function<\/span>(customTaskModel) {\n\n    <span style=\"color:#0aa\">window<\/span>[globalSendHitTaskName] = <span style=\"color:#0aa\">window<\/span>[globalSendHitTaskName] || customTaskModel.get(<span style=\"color:#a50\">'sendHitTask'<\/span>);\n    <span style=\"color:#00a\">var<\/span> tempFieldObject, dimensionIndex, count, ga, tracker, decorateTimer, decorateIframe, iframe;\n\n    <span style=\"color:#00a\">if<\/span> (<span style=\"color:#00a\">typeof<\/span> iframeDecorator === <span style=\"color:#a50\">'object'<\/span> &amp;&amp; <span style=\"color:#00a\">typeof<\/span> iframeDecorator.selector === <span style=\"color:#a50\">'string'<\/span> &amp;&amp; <span style=\"color:#00a\">typeof<\/span> iframeDecorator.attempts === <span style=\"color:#a50\">'number'<\/span> &amp;&amp; <span style=\"color:#00a\">typeof<\/span> iframeDecorator.intervalMs === <span style=\"color:#a50\">'number'<\/span>) {\n      count = <span style=\"color:#099\">0<\/span>;\n      ga = <span style=\"color:#0aa\">window<\/span>[<span style=\"color:#0aa\">window<\/span>[<span style=\"color:#a50\">'GoogleAnalyticsObject'<\/span>]];\n      tracker = ga.getByName(customTaskModel.get(<span style=\"color:#a50\">'name'<\/span>));\n      decorateIframe = <span style=\"color:#00a\">function<\/span>() {\n        iframe = <span style=\"color:#0aa\">document<\/span>.querySelector(iframeDecorator.selector);\n        <span style=\"color:#00a\">if<\/span> (iframe !== <span style=\"color:#00a\">null<\/span> &amp;&amp; <span style=\"color:#099\">\/[?&amp;]_ga=\/<\/span>.test(iframe.src)) {\n          <span style=\"color:#0aa\">window<\/span>.clearInterval(decorateTimer);\n          <span style=\"color:#00a\">return<\/span>;\n        }\n        <span style=\"color:#00a\">if<\/span> (iframe === <span style=\"color:#00a\">null<\/span>) {\n          count += <span style=\"color:#099\">1<\/span>;\n          <span style=\"color:#00a\">if<\/span> (count === iframeDecorator.attempts) {\n            <span style=\"color:#0aa\">window<\/span>.clearInterval(decorateTimer);\n          }\n          <span style=\"color:#00a\">return<\/span>;\n        }\n        <span style=\"color:#0aa\">window<\/span>.clearInterval(decorateTimer);\n        iframe.src = (<span style=\"color:#00a\">new<\/span> <span style=\"color:#0aa\">window<\/span>.gaplugins.Linker(tracker)).decorate(iframe.src, iframeDecorator.useAnchor);\n      };\n      decorateTimer = <span style=\"color:#0aa\">window<\/span>.setInterval(decorateIframe, iframeDecorator.intervalMs);\n    }\n\n  };\n}\n<\/code><\/pre>\n<\/div>\n<p>To begin with, make sure to edit the configuration object <code>iframeDecorator<\/code>. Set the parameters to their correct values.<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Example value<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>selector<\/td>\n<td><code>\"#decorateMe\"<\/code><\/td>\n<td>String with the <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/10-useful-css-selectors\/\">CSS selector<\/a> that matches the iframe you want to decorate.<\/td>\n<\/tr>\n<tr>\n<td>attempts<\/td>\n<td><code>10<\/code><\/td>\n<td>Number denoting how many times the page is polled for the iframe until the script stops trying.<\/td>\n<\/tr>\n<tr>\n<td>intervalMs<\/td>\n<td><code>1000<\/code><\/td>\n<td>Milliseconds between each attempt to find the iframe on the page.<\/td>\n<\/tr>\n<tr>\n<td>useAnchor<\/td>\n<td><code>false<\/code><\/td>\n<td>Whether to use a hash (<code>#<\/code>) instead of a URL query parameter to append the linker parameter to the iframe src.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Once you\u2019ve edited these, you\u2019ll need to add this <code>customTask<\/code> to your trackers or tags.<\/p>\n<p>Make sure to add this <code>customTask<\/code> to a hit or tag that fires after (or shortly before) the iframe element has been added to the page. The script has a timeout which is <code>attempts * intervalMs<\/code> milliseconds, so if the script doesn\u2019t find the iframe by this timeout, the script will no longer poll the page, and the iframe will remain undecorated.<\/p>\n<p><strong>For example<\/strong>, if the iframe is in the page HTML template itself, it\u2019s typically enough to add this <code>customTask<\/code> to the Page View hit that fires as soon as the page starts to load (so <strong>All Pages<\/strong> trigger in GTM, or the on-page snippet if using Universal Analytics).<\/p>\n<p>But if the iframe is added in a modal upon the click of a button, for example, you\u2019ll want to fire a Google Analytics hit <em>with<\/em> that click, and then make sure to include this <code>customTask<\/code> in the hit.<\/p>\n<h2 id=\"how-it-works\">How it works<\/h2>\n<p>When the hit to Google Analytics is generated, this <code>customTask<\/code> repeatedly asks the page: \u201cIs there an iframe that matches the given CSS selector?\u201d. If this iframe is found before the timeout (<code>attempts * intervalMs<\/code>), then the iframe path is decorated with the <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/analyticsjs\/linker\">cross-domain linker parameter<\/a>.<\/p>\n<p>This, in turn, means that when the page within the iframe loads, the URL of the page will have the <code>_ga=<\/code> cross-domain linker parameter, which is then utilized by the first tag that fires in the iframe with the <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/analyticsjs\/linker#configuring_a_site_to_accept_linker_parameters\"><code>allowLinker<\/code><\/a> flag set to <code>true<\/code>.<\/p>\n<h2 id=\"caveats\">Caveats<\/h2>\n<p>Note that this <strong>only decorates the iframe <code>src<\/code> path<\/strong>. This is the only thing you can do from the source site, so if it doesn\u2019t work, you\u2019re out of luck with this solution. Some iframes might introduce a redirect when the original <code>src<\/code> is loaded, which often eliminates the query parameter from the URL. If this is the case, you can try setting the <code>useAnchor<\/code> parameter to <code>true<\/code>, which might be more resilient to redirects.<\/p>\n<blockquote>\n<p>If you\u2019re interested in a viable alternative to the linker parameter, take a look at the <code>postMessage API<\/code> introduced in <a href=\"https:\/\/www.bounteous.com\/insights\/2015\/11\/24\/tracking-complex-interactions-in-iframes-embedded-server-side-google-analytics-iframes-pt-4\/\">this great article<\/a> by Dan Wilkerson from Bounteous.<\/p>\n<\/blockquote>\n<p>Be wary, also, that this <code>customTask<\/code> uses the cookie configuration of the hit that the <code>customTask<\/code> was added to. So if this hit has an exceptional cookie configuration, it\u2019s possible the linker is built with the wrong Client ID.<\/p>\n<p>In other words, make sure you are aware of any modifications to the default cookie settings in the tracker, hit or tag to which the <code>customTask<\/code> is added.<\/p>\n<p>There is no real penalty to adding this <code>customTask<\/code> directly to the tracker or all your Universal Analytics tags. If the iframe already has a cross-domain parameter in the <code>src<\/code> value, the script simply stops attempting to decorate the iframe.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>This is an alternative approach to my <a href=\"https:\/\/www.simoahava.com\/analytics\/iframe-cross-domain-tracking-in-google-tag-manager\/\">original solution<\/a> of using <code>hitCallback<\/code> to decorate the iframe. In my humble opinion, I think this <code>customTask<\/code> wipes the floor with my original idea, so I\u2019m fully recommending using this instead.<\/p>\n<p>My feelings on iframes haven\u2019t really changed since writing the original article, so I\u2019ll just include the relevant excerpt here for you to sympathize with.<\/p>\n<div style=\"aspect-ratio: 1560 \/ 800;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2018\/09\/iframes-suck.jpg\" title=\"iframes suck\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"800\" width=\"1560\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2018\/09\/iframes-suck.jpg#ZgotmplZ\" alt=\"iframes suck\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>If you want to vent, please let me know what you think about iframes in the comments of this article.<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>**Last updated 18 September 2020: Due to how most browsers now have third-party cookie protections in place, this solution will be very ineffective going forwards. You should instead take a look at a cookieless solution. Some years ago, I wrote a post on how to track cross-domain iframes when using Google Tag Manager and Google [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":104022,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[35252,44022,3080,1706,47855],"dealstore":[],"offerexpiration":[],"class_list":["post-104021","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-crossdomain","tag-iframes","tag-solution","tag-tracking","tag-upgraded"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tracking Cross-domain Iframes - Upgraded Solution - 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=104021\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tracking Cross-domain Iframes - Upgraded Solution - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"**Last updated 18 September 2020: Due to how most browsers now have third-party cookie protections in place, this solution will be very ineffective going forwards. You should instead take a look at a cookieless solution. Some years ago, I wrote a post on how to track cross-domain iframes when using Google Tag Manager and Google [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=104021\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-22T20:37:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/iframe-cross-domain.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1756\" \/>\n\t<meta property=\"og:image:height\" content=\"918\" \/>\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=104021#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=104021\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Tracking Cross-domain Iframes &#8211; Upgraded Solution\",\"datePublished\":\"2025-02-22T20:37:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=104021\"},\"wordCount\":903,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=104021#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/iframe-cross-domain.jpg\",\"keywords\":[\"Crossdomain\",\"Iframes\",\"Solution\",\"Tracking\",\"Upgraded\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=104021#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=104021\",\"url\":\"https:\/\/fivemor.com\/?p=104021\",\"name\":\"Tracking Cross-domain Iframes - Upgraded Solution - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=104021#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=104021#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/iframe-cross-domain.jpg\",\"datePublished\":\"2025-02-22T20:37:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=104021#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=104021\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=104021#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/iframe-cross-domain.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/iframe-cross-domain.jpg\",\"width\":1756,\"height\":918},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=104021#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tracking Cross-domain Iframes &#8211; Upgraded Solution\"}]},{\"@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":"Tracking Cross-domain Iframes - Upgraded Solution - 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=104021","og_locale":"en_US","og_type":"article","og_title":"Tracking Cross-domain Iframes - Upgraded Solution - Som2ny Network","og_description":"**Last updated 18 September 2020: Due to how most browsers now have third-party cookie protections in place, this solution will be very ineffective going forwards. You should instead take a look at a cookieless solution. Some years ago, I wrote a post on how to track cross-domain iframes when using Google Tag Manager and Google [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=104021","og_site_name":"Som2ny Network","article_published_time":"2025-02-22T20:37:18+00:00","og_image":[{"width":1756,"height":918,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/iframe-cross-domain.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=104021#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=104021"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Tracking Cross-domain Iframes &#8211; Upgraded Solution","datePublished":"2025-02-22T20:37:18+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=104021"},"wordCount":903,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=104021#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/iframe-cross-domain.jpg","keywords":["Crossdomain","Iframes","Solution","Tracking","Upgraded"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=104021#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=104021","url":"https:\/\/fivemor.com\/?p=104021","name":"Tracking Cross-domain Iframes - Upgraded Solution - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=104021#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=104021#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/iframe-cross-domain.jpg","datePublished":"2025-02-22T20:37:18+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=104021#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=104021"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=104021#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/iframe-cross-domain.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/iframe-cross-domain.jpg","width":1756,"height":918},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=104021#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Tracking Cross-domain Iframes &#8211; Upgraded Solution"}]},{"@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\/104021","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=104021"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/104021\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/104022"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=104021"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=104021"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=104021"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=104021"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=104021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}