{"id":25479,"date":"2026-09-05T02:43:57","date_gmt":"2026-09-04T23:43:57","guid":{"rendered":"https:\/\/alienroad.com\/google-bilgi-bankasi\/enabling-your-ad-network-to-work-with-translation-related-google-search-features\/"},"modified":"2026-09-05T02:43:57","modified_gmt":"2026-09-04T23:43:57","slug":"enabling-your-ad-network-to-work-with-translation-related-google-search-features","status":"publish","type":"ar_kb","link":"https:\/\/alienroad.com\/google-bilgi-bankasi\/enabling-your-ad-network-to-work-with-translation-related-google-search-features\/","title":{"rendered":"Enabling your ad network to work with translation-related Google Search features"},"content":{"rendered":"<p>\n      Google Search offers several <a href=\"https:\/\/alienroad.com\/google-bilgi-bankasi\/translated-results\/\">translation-related features<\/a><br \/>\n      that enable users to access translated content. If you run an ad network and your ads aren&#8217;t<br \/>\n      working properly on translated web pages, you&#8217;ll need to follow the steps in this guide to<br \/>\n      make sure your ads render or attribute correctly.\n    <\/p>\n<h2 id=\"our-approach\" tabindex=\"-1\">Our approach<\/h2>\n<p>\n      When users access translated content provided by <a href=\"https:\/\/translate.google.com\/about\/\" class=\"external-link\">Google<br \/>\n      Translate<\/a> from within search results, Google retrieves the page from the publisher, rewrites<br \/>\n      the source URL, and translates the web page after the user clicks the translated result.\n    <\/p>\n<h2 id=\"convert-the-google-translate-url-to-the-original-url\" tabindex=\"-1\">Convert the Google Translate URL to the original URL<\/h2>\n<p>\n    If you run an ad network that relies on the publisher\u2019s source URL, you&#8217;ll need to convert the<br \/>\n      Google Translate URL to make sure your ads are working properly. Follow these steps to decode the publisher\u2019s hostname:\n    <\/p>\n<ol>\n<li>Extract the domain prefix from the hostname, by removing the <code>.translate.goog<\/code> suffix.\n<li>Split the <code>_x_tr_enc<\/code> parameter by the <code>,<\/code> (comma) character and save it as <code>encoding_list<\/code>.\n<li>Prepend the value of the <code>_x_tr_hp<\/code> parameter to the domain prefix, if it exists.\n<li>If <code>encoding_list<\/code> contains <code>1<\/code> and the output begins with <code>1-<\/code>, remove the <code>1-<\/code> prefix from the output of step 2.\n<li>If <code>encoding_list<\/code> contains <code>0<\/code> and the output begins with <code>0-<\/code>, remove the <code>0-<\/code> prefix from the output of step 3. If you removed the prefix, set <code>is_idn<\/code> to <code>true<\/code>. Otherwise, set <code>is_idn<\/code> to <code>false<\/code>.\n<li>Replace <code>\/b-b\/<\/code> (regex) with the <code>.<\/code> (dot) character.\n<li>Replace the <code>--<\/code> (double hyphen) character with the <code>-<\/code> (hyphen) character.\n<li>If <code>is_idn<\/code> is set to <code>true<\/code>, add the punycode prefix <code>xn--<\/code>.\n<li><b>Optional<\/b>: Convert to Unicode.\n      <\/li>\n<\/ol>\n<h3 id=\"sample-javascript-code-for-decoding-the-hostname-from-a-google-translate-url\" tabindex=\"-1\">\n      Sample JavaScript code for decoding the hostname from a Google Translate URL<br \/>\n    <\/h3>\n<div><\/div>\n<h2 id=\"reconstruct-the-url\" tabindex=\"-1\">Reconstruct the URL<\/h2>\n<ol>\n<li>Using the original page URL, replace the hostname with the decoded hostname.<\/li>\n<li>Remove all <code>_x_tr_*<\/code> parameters.<\/li>\n<\/ol>\n<h2 id=\"test-your-code\" tabindex=\"-1\">Test your code<\/h2>\n<p>\n      You can create unit tests for your code using the following table. Given a <code>proxyUrl<\/code>,<br \/>\n      the <code>decodeHostname<\/code> must match the expected value.\n    <\/p>\n<p>\n      The following table can only be used to test the hostname decoding. You\u2019ll need to ensure that<br \/>\n      the path, fragment, and original parameters of the URL are preserved as is.\n    <\/p>\n<table class=\"fixed vertical-rules\">\n<tr>\n<th width=\"50%\"><code>proxyUrl<\/code>\n       <\/th>\n<th width=\"50%\"><code>decodeHostname<\/code>\n       <\/th>\n<\/tr>\n<tr>\n<td><code>https:\/\/example-com.translate.goog<\/code>\n       <\/td>\n<td><code>example.com<\/code>\n       <\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/foo-example-com.translate.goog<\/code>\n       <\/td>\n<td><code>foo.example.com<\/code>\n       <\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/foo--example-com.translate.goog<\/code>\n       <\/td>\n<td><code>foo-example.com<\/code>\n       <\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/0-57hw060o-com.translate.goog\/?_x_tr_enc=0<\/code>\n       <\/td>\n<td><code>xn--57hw060o.com (\u26a1\ud83d\ude0a.com)<\/code>\n       <\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/1-en--us-example-com\/?_x_tr_enc=1<\/code>\n       <\/td>\n<td><code>en-us.example.com<\/code>\n       <\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/0-en----w45as309w-com.translate.goog\/?_x_tr_enc=0<\/code>\n       <\/td>\n<td><code>xn--en--w45as309w.com (en-\u26a1\ud83d\ude0a.com)<\/code>\n       <\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/1-0-----16pw588q-com.translate.goog\/?_x_tr_enc=0,1<\/code>\n       <\/td>\n<td><code>xn----16pw588q.com (\u26a1-\ud83d\ude0a.com)<\/code>\n       <\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/lanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch-co-uk.translate.goog\/?_x_tr_hp=l<\/code>\n       <\/td>\n<td><code>llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch.co.uk<\/code>\n       <\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/lanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch-co-uk.translate.goog\/?_x_tr_hp=www-l<\/code>\n       <\/td>\n<td><code>www.llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch.co.uk<\/code>\n       <\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/a--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-com.translate.goog\/?_x_tr_hp=a--xn--xn--xn--xn--xn--------------------------a<\/code>\n       <\/td>\n<td><code>a-xn-xn-xn-xn-xn-------------aa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com<\/code>\n       <\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/g5h3969ntadg44juhyah3c9aza87iiar4i410avdl8d3f1fuq3nz05dg5b-com.translate.goog\/?_x_tr_enc=0&amp;_x_tr_hp=0-<\/code>\n       <\/td>\n<td><code>xn--g5h3969ntadg44juhyah3c9aza87iiar4i410avdl8d3f1fuq3nz05dg5b.com (\ud83d\udc96\ud83c\udf32\ud83d\ude0a\ud83d\udc9e\ud83e\udd37\u200d\u2642\ufe0f\ud83d\udc97\ud83c\udf39\ud83d\ude0d\ud83c\udf38\ud83c\udf3a\ud83d\ude02\ud83d\ude29\ud83d\ude09\ud83d\ude12\ud83d\ude18\ud83d\udc95\ud83d\udc36\ud83d\udc31\ud83d\udc2d\ud83d\udc39\ud83d\udc30\ud83d\udc3b\ud83e\udd8a\ud83d\udc07\ud83d\ude3a.com)<\/code>\n       <\/td>\n<\/tr>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Learn how you can enable your ad network to render or attribute correctly with translation-related Google Search features.<\/p>\n","protected":false},"menu_order":116,"template":"","meta":{"footnotes":""},"ar_kb_kategori":[672],"ar_kb_etiket":[],"class_list":["post-25479","ar_kb","type-ar_kb","status-publish","has-post-thumbnail","hentry","ar_kb_kategori-translated-features"],"_links":{"self":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb\/25479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb"}],"about":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/types\/ar_kb"}],"version-history":[{"count":0,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb\/25479\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media\/27518"}],"wp:attachment":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media?parent=25479"}],"wp:term":[{"taxonomy":"ar_kb_kategori","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_kategori?post=25479"},{"taxonomy":"ar_kb_etiket","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_etiket?post=25479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}