{"id":15139,"date":"2026-10-01T03:37:06","date_gmt":"2026-10-01T03:37:06","guid":{"rendered":"https:\/\/playgama.com\/blog\/?p=15139"},"modified":"2026-10-01T03:37:06","modified_gmt":"2026-10-01T03:37:06","slug":"how-to-detect-host-portals-using-url-parameters-in-multi-por","status":"publish","type":"post","link":"https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/","title":{"rendered":"How to detect host portals using URL parameters in multi-portal builds?"},"content":{"rendered":"<p><strong>Ask each portal how it identifies its iframe (usually a query parameter on the game URL, sometimes the referrer) and check it once at load with a small switch, so one build can adjust ad calls or branding per portal without shipping separate builds.<\/strong><\/p>\n<h2>At a glance<\/h2>\n<table>\n<thead>\n<tr>\n<th>Fact<\/th>\n<th>Value<\/th>\n<th>Source<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>CrazyGames iframe check<\/td>\n<td>query param + absoluteURL.Contains<\/td>\n<td><a href=\"https:\/\/docs.crazygames.com\/sdk\/intro\/\" rel=\"nofollow noopener\" target=\"_blank\">docs.crazygames.com<\/a><\/td>\n<\/tr>\n<tr>\n<td>CrazyGames local dev override<\/td>\n<td>?useLocalSdk=true<\/td>\n<td><a href=\"https:\/\/docs.crazygames.com\/sdk\/intro\/\" rel=\"nofollow noopener\" target=\"_blank\">docs.crazygames.com<\/a><\/td>\n<\/tr>\n<tr>\n<td>Detecting host portals<\/td>\n<td>check query parameters at load<\/td>\n<td><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Games\" rel=\"nofollow noopener\" target=\"_blank\">developer.mozilla.org<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Read the query string on the URL your game is loaded with, and match it against the parameter each portal documents for its own iframe. For example, you can add a query parameter to your iframe URL when submitting and inspect the page URL in code. That is the pattern to copy for any other portal: agree on a parameter with the portal (or read one they already append), then branch your ad calls, SDK init, or branding based on it.<\/p>\n<p>For deploying builds, <a href=\"https:\/\/playgama.com\/mcp\/\">Playgama MCP<\/a> lets coding agents upload builds and publish sandboxes directly.<\/p>\n<h2>What should you check per portal?<\/h2>\n<ul>\n<li>Ask the portal&#8217;s own docs for the exact parameter name and value &#8211; they differ per portal and can change, so don&#8217;t hardcode one you found once.<\/li>\n<li>Do the check once at startup, cache the result, and don&#8217;t re-read the URL on every ad call.<\/li>\n<li>Keep a local-dev override separate from portal detection to force local testing parameters independently.<\/li>\n<li>If no known parameter matches, treat it as your own site or an unlisted embed and use safe defaults rather than crashing.<\/li>\n<\/ul>\n<h2>Sources<\/h2>\n<ul>\n<li><a href=\"https:\/\/docs.crazygames.com\/sdk\/intro\/\" rel=\"nofollow noopener\" target=\"_blank\">Introduction &#8211; CrazyGames Documentation<\/a><\/li>\n<li><a href=\"https:\/\/playgama.com\/developers\" rel=\"nofollow noopener\" target=\"_blank\">Playgama for developers<\/a><\/li>\n<li><a href=\"https:\/\/wiki.playgama.com\/playgama\/mcp\" rel=\"nofollow noopener\" target=\"_blank\">Playgama: MCP Server: Publish Games from Your AI Agent<\/a><\/li>\n<\/ul>\n<h2>Related questions<\/h2>\n<h3>Should I detect the portal from the referrer instead of a query parameter?<\/h3>\n<p>You can, but referrers can be stripped or rewritten by proxies and some browsers. A documented query parameter agreed with the portal is more reliable.<\/p>\n<h3>Do I need a separate build for each portal?<\/h3>\n<p>No &#8211; one build can branch behaviour at runtime by reading the portal parameter, which is simpler than maintaining separate builds for each distribution target.<\/p>\n<p><em>Last updated: 30 September 2026<\/em><\/p>\n<p><script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"How to detect host portals using URL parameters in multi-portal builds?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Ask each portal how it identifies its iframe (usually a query parameter on the game URL, sometimes the referrer) and check it once at load with a small switch, so one build can adjust ad calls or branding per portal without shipping separate builds.\"}}, {\"@type\": \"Question\", \"name\": \"Should I detect the portal from the referrer instead of a query parameter?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"You can, but referrers can be stripped or rewritten by proxies and some browsers. A documented query parameter agreed with the portal is more reliable.\"}}, {\"@type\": \"Question\", \"name\": \"Do I need a separate build for each portal?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No - one build can branch behaviour at runtime by reading the portal parameter, which is simpler than maintaining separate builds for each distribution target.\"}}], \"datePublished\": \"2026-09-30\", \"dateModified\": \"2026-09-30\", \"inLanguage\": \"en\"}<\/script><br \/>\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@graph\": [{\"@type\": \"Organization\", \"name\": \"Playgama\", \"sameAs\": [\"https:\/\/www.wikidata.org\/wiki\/Q140768339\", \"https:\/\/playgama.com\/\"]}]}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ask each portal how it identifies its iframe (usually a query parameter on the game URL, sometimes the referrer) and check it once at load with a small switch, so one build can adjust ad calls or branding per portal without shipping separate builds.<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"footnotes":""},"categories":[1318],"tags":[],"class_list":["post-15139","post","type-post","status-publish","format-standard","hentry","category-business-faqs"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to detect host portals using URL parameters in multi-portal builds?<\/title>\n<meta name=\"description\" content=\"Detect which portal is hosting your HTML5 game by reading a query parameter appended to the iframe URL, per-portal, checked once at load.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to detect host portals using URL parameters in multi-portal builds?\" \/>\n<meta property=\"og:description\" content=\"Detect which portal is hosting your HTML5 game by reading a query parameter appended to the iframe URL, per-portal, checked once at load.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/\" \/>\n<meta property=\"og:site_name\" content=\"Playgama Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-01T03:37:06+00:00\" \/>\n<meta name=\"author\" content=\"David Sedrakyan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Sedrakyan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/business-faqs\\\/how-to-detect-host-portals-using-url-parameters-in-multi-por\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/business-faqs\\\/how-to-detect-host-portals-using-url-parameters-in-multi-por\\\/\"},\"author\":{\"name\":\"David Sedrakyan\",\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/#\\\/schema\\\/person\\\/5bbe086be334a842649a21fd6514a306\"},\"headline\":\"How to detect host portals using URL parameters in multi-portal builds?\",\"datePublished\":\"2026-10-01T03:37:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/business-faqs\\\/how-to-detect-host-portals-using-url-parameters-in-multi-por\\\/\"},\"wordCount\":370,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/#organization\"},\"articleSection\":[\"Business FAQs\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/playgama.com\\\/blog\\\/business-faqs\\\/how-to-detect-host-portals-using-url-parameters-in-multi-por\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/business-faqs\\\/how-to-detect-host-portals-using-url-parameters-in-multi-por\\\/\",\"url\":\"https:\\\/\\\/playgama.com\\\/blog\\\/business-faqs\\\/how-to-detect-host-portals-using-url-parameters-in-multi-por\\\/\",\"name\":\"How to detect host portals using URL parameters in multi-portal builds?\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/#website\"},\"datePublished\":\"2026-10-01T03:37:06+00:00\",\"description\":\"Detect which portal is hosting your HTML5 game by reading a query parameter appended to the iframe URL, per-portal, checked once at load.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/business-faqs\\\/how-to-detect-host-portals-using-url-parameters-in-multi-por\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/playgama.com\\\/blog\\\/business-faqs\\\/how-to-detect-host-portals-using-url-parameters-in-multi-por\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/business-faqs\\\/how-to-detect-host-portals-using-url-parameters-in-multi-por\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/playgama.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to detect host portals using URL parameters in multi-portal builds?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/playgama.com\\\/blog\\\/\",\"name\":\"Playgama Blog: \ud83c\udfae Insights, Tutorials, and Creative Inspiration for Game Development \ud83d\ude80\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/playgama.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/#organization\",\"name\":\"Playgama Blog: \ud83c\udfae Insights, Tutorials, and Creative Inspiration for Game Development \ud83d\ude80\",\"url\":\"https:\\\/\\\/playgama.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/playgama.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-playgama-scaled-1.png\",\"contentUrl\":\"https:\\\/\\\/playgama.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-playgama-scaled-1.png\",\"width\":2559,\"height\":523,\"caption\":\"Playgama Blog: \ud83c\udfae Insights, Tutorials, and Creative Inspiration for Game Development \ud83d\ude80\"},\"image\":{\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/playgama.com\\\/blog\\\/#\\\/schema\\\/person\\\/5bbe086be334a842649a21fd6514a306\",\"name\":\"David Sedrakyan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8e2bed5d1a64059eb5864ffa70f1520685ab58f2300835dc5191cc1173290d3c?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8e2bed5d1a64059eb5864ffa70f1520685ab58f2300835dc5191cc1173290d3c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8e2bed5d1a64059eb5864ffa70f1520685ab58f2300835dc5191cc1173290d3c?s=96&d=mm&r=g\",\"caption\":\"David Sedrakyan\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/david-sedrakyan-77b930199\\\/\"],\"url\":\"https:\\\/\\\/playgama.com\\\/blog\\\/author\\\/david\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to detect host portals using URL parameters in multi-portal builds?","description":"Detect which portal is hosting your HTML5 game by reading a query parameter appended to the iframe URL, per-portal, checked once at load.","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:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/","og_locale":"en_US","og_type":"article","og_title":"How to detect host portals using URL parameters in multi-portal builds?","og_description":"Detect which portal is hosting your HTML5 game by reading a query parameter appended to the iframe URL, per-portal, checked once at load.","og_url":"https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/","og_site_name":"Playgama Blog","article_published_time":"2026-10-01T03:37:06+00:00","author":"David Sedrakyan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Sedrakyan","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/#article","isPartOf":{"@id":"https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/"},"author":{"name":"David Sedrakyan","@id":"https:\/\/playgama.com\/blog\/#\/schema\/person\/5bbe086be334a842649a21fd6514a306"},"headline":"How to detect host portals using URL parameters in multi-portal builds?","datePublished":"2026-10-01T03:37:06+00:00","mainEntityOfPage":{"@id":"https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/"},"wordCount":370,"commentCount":0,"publisher":{"@id":"https:\/\/playgama.com\/blog\/#organization"},"articleSection":["Business FAQs"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/","url":"https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/","name":"How to detect host portals using URL parameters in multi-portal builds?","isPartOf":{"@id":"https:\/\/playgama.com\/blog\/#website"},"datePublished":"2026-10-01T03:37:06+00:00","description":"Detect which portal is hosting your HTML5 game by reading a query parameter appended to the iframe URL, per-portal, checked once at load.","breadcrumb":{"@id":"https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/playgama.com\/blog\/business-faqs\/how-to-detect-host-portals-using-url-parameters-in-multi-por\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/playgama.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to detect host portals using URL parameters in multi-portal builds?"}]},{"@type":"WebSite","@id":"https:\/\/playgama.com\/blog\/#website","url":"https:\/\/playgama.com\/blog\/","name":"Playgama Blog: \ud83c\udfae Insights, Tutorials, and Creative Inspiration for Game Development \ud83d\ude80","description":"","publisher":{"@id":"https:\/\/playgama.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/playgama.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/playgama.com\/blog\/#organization","name":"Playgama Blog: \ud83c\udfae Insights, Tutorials, and Creative Inspiration for Game Development \ud83d\ude80","url":"https:\/\/playgama.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/playgama.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/playgama.com\/blog\/wp-content\/uploads\/2026\/04\/cropped-playgama-scaled-1.png","contentUrl":"https:\/\/playgama.com\/blog\/wp-content\/uploads\/2026\/04\/cropped-playgama-scaled-1.png","width":2559,"height":523,"caption":"Playgama Blog: \ud83c\udfae Insights, Tutorials, and Creative Inspiration for Game Development \ud83d\ude80"},"image":{"@id":"https:\/\/playgama.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/playgama.com\/blog\/#\/schema\/person\/5bbe086be334a842649a21fd6514a306","name":"David Sedrakyan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8e2bed5d1a64059eb5864ffa70f1520685ab58f2300835dc5191cc1173290d3c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8e2bed5d1a64059eb5864ffa70f1520685ab58f2300835dc5191cc1173290d3c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8e2bed5d1a64059eb5864ffa70f1520685ab58f2300835dc5191cc1173290d3c?s=96&d=mm&r=g","caption":"David Sedrakyan"},"sameAs":["https:\/\/www.linkedin.com\/in\/david-sedrakyan-77b930199\/"],"url":"https:\/\/playgama.com\/blog\/author\/david\/"}]}},"_links":{"self":[{"href":"https:\/\/playgama.com\/blog\/wp-json\/wp\/v2\/posts\/15139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/playgama.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/playgama.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/playgama.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/playgama.com\/blog\/wp-json\/wp\/v2\/comments?post=15139"}],"version-history":[{"count":1,"href":"https:\/\/playgama.com\/blog\/wp-json\/wp\/v2\/posts\/15139\/revisions"}],"predecessor-version":[{"id":15272,"href":"https:\/\/playgama.com\/blog\/wp-json\/wp\/v2\/posts\/15139\/revisions\/15272"}],"wp:attachment":[{"href":"https:\/\/playgama.com\/blog\/wp-json\/wp\/v2\/media?parent=15139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/playgama.com\/blog\/wp-json\/wp\/v2\/categories?post=15139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/playgama.com\/blog\/wp-json\/wp\/v2\/tags?post=15139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}